Pages: 1
Print
Author Topic: Pretty Printing not being applied to Table elements  (Read 2143 times)
4fingers
Member

Posts: 11


« on: March 06, 2009, 11:50:44 AM »

Hi,
I have XMetaL Author Essential 5.5 and have been editing the CTM file so that I get indentation in the text view. It seems to work on everything except Tables:

When I create a table in tag view and go into text view I see this:
Code:
<TABLE border="1"><TR><TD></TD></TR></TABLE>

I then have to place spaces in between the elements in order to trigger the indentation:
Code:
<TABLE border="1"> <TR> <TD> </TD> </TR> </TABLE>

Once I switch back to text view the table is nicely indented:
Code:
<TABLE border="1">
     <TR>
          <TD> </TD>
     </TR>
</TABLE>

If it helps here is the section in the CTM file that specifies how the Table should be formatted:
Code:
<ElementProperties>
    <Name>TABLE</Name>
    <LongDescription>Table</LongDescription>
    <PrettyPrintOptions> <NewLineBeforeStartTag/> <NewLineBeforeEndTag/>
      <IndentContent/>
    </PrettyPrintOptions>
   </ElementProperties>

<ElementProperties>
    <Name>TD</Name>
    <LongDescription>Cell in the body of a table</LongDescription>
    <PrettyPrintOptions> <NewLineBeforeStartTag/> <IndentContent/>
    </PrettyPrintOptions>
   </ElementProperties>

<ElementProperties>
    <Name>TR</Name>
    <LongDescription>Table row</LongDescription>
    <PrettyPrintOptions>
    <NewLineBeforeStartTag/>
    <NewLineBeforeEndTag/>
      <IndentContent/>
    </PrettyPrintOptions>
   </ElementProperties>

It must be something to do with my CTM file as the Journalist template has no problems formatting Table elements.

Thanks
Logged
Derek Read
Program Manager (XMetaL)
Administrator
Member

Posts: 1548



WWW
« Reply #1 on: March 06, 2009, 04:03:22 PM »

If pretty printing is being applied but only after you manually introduce whitespace that sounds like a bug to me. I can't reproduce this in 5.1 so I'll load up 5.5 when I get a minute and see if it is specific to that version.

If you can provide your schema and a sample XML document to XMetaL Support it that would be best. In theory it should not make a difference, but if this is due to a bug then it might.

There's nothing wrong with your CTM settings that I can see, provided that what you show in your "the table is nicely indented" section is what you actually want (there are far more pretty printing settings available).
Logged
Pages: 1
Print
Jump to:  

email us