Copy link to clipboard
Copied
Hello,
I have an XML document that contains features of one item and I want to add data from it to FM document that shows those features. These features have been added to FM previously by copy-paste technology which isn't obviosly the fastest way and I have understood adding them automatically is possible.
I can read XML well and I can produce XSLT files to make another XML files, problem is that I'm a little beginner with FM and help files didn't show any good examples of this (or at least I didn't find). I tried to do some read/write rules, because it seemed to be the way how FM handles these things but they didn't work.
So shortly: XML file (data) + FM file (tables and such) = FM file which have XML data in its tables
I would appreciate any help, like pointing to right help files or such, thanks in advance.
Copy link to clipboard
Copied
The two main references you need are:
Developing Structured Applications with FrameMaker, Guide
Developing Structured Applications with FrameMaker, Reference
They used to ship with FrameMaker, but you can download them from the Adobe site. Check the Support section. I do not believe they are available for FrameMaker 10 yet, but they are for version 9. No matter your FramMaker version, almost any set will do.
Basically, you need an XSLT that will translate the XML structure into the structure you use in your FrameMaker files. You need a set of read/write rules (see the references above). FrameMaker uses read/write rules to specify how certain FrameMaker objects are to be translated from the XML. Such objects include tables, variables, and markers.
Then you need to create a structured application that specifies where the XSLT, the read/write rules, and your structured template are located on you system.Again, see the references.
Once all of the above is in place, you open the XML file from within FrameMaker. FrameMaker will ask you what structured application to use, which you pick from the dropdown list. It will then open the XML file, apply the XSLT transformation, and copy the result into your structured blank template. That process will likely list several errors, which you may or may not be able to ignore depending upon the resulting FrameMaker document. In my case, these are usually errors about missing graphics, which I already know are missing.
The result is ONE FrameMaker file. You can then copy and paste the information where ever you need it in your other documents. I am not sure whether you can import an XML file into an existing Framemaker document, much like a text inset. Maybe others will know.
Good luck,
Van
Copy link to clipboard
Copied
Thanks for your help, Val. Those documents you said didn't help, but they and your text pointed me to hopefully correct path. I found this document http://help.adobe.com/en_US/FrameMaker/8.0/xslt_frame.pdf and following instructions in it I actually was able to open my xml file so it showed items like I have wanted them to be shown. Some links in that pdf doesn't work anymore, if someone else ever looks this topic. but at least for me it was helpful enough.
I don't put this yet answered, since I need to test some more, so this was only update to my project.
Copy link to clipboard
Copied
Little more updates for my progress, like I said before, I could open XML-file so it transformed to form I wanted wasn't actually true, because I have xml-file that has items like this:
<thing>
<item1>foo</item1>
<item2>bar</item2>
</thing>
<thing>....
and in XSLT-file they are
<Row>
<Cell><xsl:value-of select="item1"/></Cell>
<Cell><xsl:value-of select="item2"/></Cell>
</Row>
they transform to FrameMaker like this:
<Row>
<Cell>foobar</Cell>
<Row>
when I have tried this with external xslt processors and in browsers, it transforms correctly but not in FrameMaker, maybe this is just some "feature".
I tested importing XML file to existing document as part of it and found out after while that import doesn't use XSLT-file at all, even if it's defined in structapps.fm, what it uses is read/write rules and those aren't as efficient as XSLT.
Looks like that I need to look some real programming things if I would want to add those things in file like I wanted to do.
Copy link to clipboard
Copied
Because you are using the elements Row and Cell, I suspect that you want the XSLT result to be a table. If so, in order for FrameMaker to get it correct, your read/write rules need to contains something like:
element "Row" {
is fm table row element;
}
element "Cell" {
is fm table cell element;
}
These rules tell FrameMaker that Row elements are to be treated as rows in a table and that Cell elements are to be treated as cells in a table. You may also need additional rules to get the tables correct, such as:
element "TableTitle" is fm table title element;
element "TableHeading" is fm table heading element;
element "TableBody" is fm table body element;
The fact that external XSLT processors get it right means that your XSLT is OK. FrameMaker applies the XSLT first, then converts the resulting XML into a FrameMaker document; it is this latter stage where the read/write rules are applied.
Good luck,
Van
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more