Pages: 1
Print
Author Topic: Invalid tgroup attributes resulting from Selection.InsertCALSTable()  (Read 270 times)
smm735
Member

Posts: 5


« on: June 26, 2018, 02:23:51 PM »

Hi,

We have recently begun using XMax 11.0.0.084

When I call AxXmetaLControlLib.AxXMetaLControl.Selection.InsertCALSTable(2, 2, "table", True, False)  and then immediately read AxXmetaLControlLib.AxXMetaLControl.Document.xml the latter property contains the xml for my new table but looks like this:

<?xml version="1.0"?>
<table>
  <tgroup cols="cols-value" Desc="2">
    <colspec charoff="1" colnum="col1" colname="*"/>
    <colspec charoff="2" colnum="col2" colname="*"/>
    <thead>
      <row>
        <entry valign="col1">test</entry>
        <entry valign="col2">test</entry>
      </row>
    </thead>
    <tbody>
      <row>
        <entry valign="col1">test</entry>
        <entry valign="col2">test</entry>
      </row>
      <row>
        <entry valign="col1">test</entry>
        <entry valign="col2">test</entry>
      </row>
    </tbody>
  </tgroup>
</table>

More importantly, the tgroup element contains what appears to be an invalid attribute "Desc" and I don't understand why the "cols" attribute is set to "cols-value" instead of 2.  Subsequent processing chokes on the tgroup element as it does not like either the "Desc" attribute or the "cols-value" value for the "cols" attribute.

When I switch to XMax 7 (our previous version) and make the same call the xml looks like this:

<?xml version="1.0"?>
<table>
  <tgroup cols="2">
    <colspec colnum="1" colname="col1" colwidth="*"/>
    <colspec colnum="2" colname="col2" colwidth="*"/>
    <thead>
      <row>
        <entry colname="col1">test</entry>
        <entry colname="col2">test</entry>
      </row>
    </thead>
    <tbody>
      <row>
        <entry colname="col1">test</entry>
        <entry colname="col2">test</entry>
      </row>
      <row>
        <entry colname="col1">test</entry>
        <entry colname="col2">test</entry>
      </row>
    </tbody>
  </tgroup>
</table>

Any thoughts or suggestions on why I may be seeing this? 

Thanks,
Sean
Logged
Derek Read
Program Manager (XMetaL)
Administrator
Member

Posts: 2568



WWW
« Reply #1 on: June 27, 2018, 02:48:52 PM »

My first recommendation would be to try the current release.

If this was a bug in 11.0.0.084 I think it must require a specific setup to reproduce. I am unable to reproduce the issue in 11.0.0.084, 11.0.0.091 and 13.0.0.033 (current release).

Here is my test script:

Code:
//XMetaL Script Language JScript:
Selection.InsertCALSTable(2, 2, "table", true, false);
ActiveDocument.Host.Alert(ActiveDocument.xml);

This also gives me the expected results:

Code:
//XMetaL Script Language JScript:
Selection.InsertCALSTable(2, 2, "table", true, false);
if (Selection.InContextOfType("TABLE")) {
  if (Selection.MoveToElement("table",false)) {
    Selection.SelectElement();
    ActiveDocument.Host.Alert(Selection.Text);
  }
}

As does switching to Plain Text view and viewing the XML source.
Selecting the table, copying it to the clipboard, and pasting that into a text editor also gives me the correct results.

What do you see in Plain Text view?

Presumably in your case XMAX is also giving you validation errors?
If not, does the schema define an @Desc?


I'm trying to figure out which API is causing the problem for you: ActiveDocument.xml or InsertCALSTable.
Ultimately we will need to reproduce this though.

If you can reproduce this issue with 13 please let XMetaL Support know. The issue does not appear to be reproducible with a schema that supports the standard CALS table model, so if it requires a specific DTD or XSD to reproduce the issue please provide the files needed when you submit the support case.
Logged
smm735
Member

Posts: 5


« Reply #2 on: July 11, 2018, 10:05:00 AM »

Thanks Derek,

Just curious how I would get the latest release/build of XMax?  The website seems to indicate that XMax 11 is the latest release.  We were provided with 11.0.0.084 but you mentioned using 11.0.0.091 and I'm not sure how to obtain different binaries.  The Downloads page has 2 options - both for XMetaL Author, nothing for XMax.

I see that XMetal Author is at v13 but we are not using Author - just XMax.

Logged
Derek Read
Program Manager (XMetaL)
Administrator
Member

Posts: 2568



WWW
« Reply #3 on: July 12, 2018, 11:09:00 AM »

Please contact the JustSystems sales people.

In general you need to go through them to get any XMetaL software other than the current release of XMetaL Author Enterprise which runs in trial mode by default, so it's used for evaluations (licenses are still provided by the sales team). There is no trial mode for XMAX so we do not make it readily available.
« Last Edit: July 12, 2018, 11:10:41 AM by Derek Read » Logged
smm735
Member

Posts: 5


« Reply #4 on: July 12, 2018, 11:59:33 AM »

Thanks,

We have actually resolved the issue by reordering our DTD elements. 

Previously the parent element was defined before the Table elements in our DTD.  Relocating the parent element to follow the Table elements resolved the issue.  I'm not sure why we only started seeing the issue in Xmax 11 and not in Xmax 7.  I wasn't aware that the element declaration order mattered in a DTD...
Logged
Derek Read
Program Manager (XMetaL)
Administrator
Member

Posts: 2568



WWW
« Reply #5 on: July 12, 2018, 01:55:16 PM »

The order definitely does not matter. It would be useful if you were able to submit the files you are using to XMetaL Support so they can have a look and try to reproduce the issue.
Logged
Pages: 1
Print
Jump to:  

email us