Copy link to clipboard
Copied
I’m trying to reorder some table cells during conversion from SMGL to FM10, but I think the Read/Write rules don’t really do what I want them to do.
Here’s what I’ve got in SGML:
<data>
<cus>B</cus>
<mod>A</mod>
<cec>D</cec>
<acn>C</acn>
</data>
What I want is:
A | B | C | D |
My read/write rules are:
}
element "data" {
is fm table row element;
}
element "cus" {
is fm table cell element;
fm property column number value is "2";
fm property row type value is "Data";
}
element "mod" {
is fm table cell element;
fm property column number value is "1";
fm property row type value is "Data";
}
element "cec" {
is fm table cell element;
fm property column number value is "4";
fm property row type value is "Data";
}
element "acn" {
is fm table cell element;
fm property column number value is "3";
fm property row type value is "Data";
}
What I end up with is each element in its proper cell, but not in the same row:
B | |||
A | D | ||
C |
My guess it that FM reads down the SGML and applies the rules to each line as it comes to it, therefore it reads the first line and puts “B” in column 2, then it reads the second line and puts “A” in the next available column 1, which is actually in the next row. Is there a way to keep them in the same row without changing the SGML?
Thanks!
ebpdx
Copy link to clipboard
Copied
It looks like rule order matters here. Have you tried putting the 'mod' rule first, then the 'cus' rule, and so on?
Copy link to clipboard
Copied
Yes, it didn't help.
Copy link to clipboard
Copied
you can't do this with RW-Rules. But you can define an XSLT in your structured application, which does the restructuring process of you input xml.
hope this helps
Copy link to clipboard
Copied
Unfortunately, I've got SGML files, not XML files and the conversion from SGML to XML is really messy. Oh well, thanks for your help!
ebpdx
Copy link to clipboard
Copied
But you can do it in a second step.
Import SGML Files and you've got a structured FM Document.
Now you can do an XML roundtrip in an easy way and restructure that table in that step.
Copy link to clipboard
Copied
ahhh..
Don't know if this could work for this. Perhaps FM's conversion table could solve that problem.
could be a little bit tricky, but could work