Greetings. I am trying to understand the process of Adobe FrameMaker 12 with regards to a Frame Book. Specifically, the process for converting or saving a Frame Book into another format like XML. When I select to save my book as XML, I have observed in the bottom left-corner of the GUI, each file (component) being opened and saved. When I look in the directory of the referenced files, I see the book file as an XML but I also see files with an *.e<numerical value> extension. For example, I see Test.fm before converting the book. After, I see Test.e09. When I open up the file, it looks like some form of XML.
While saving the book, does FM create these files for each component and then use them as a reference to finally convert the book into an XML file?
This is normal behaviour when saving a structured FrameMaker book to XML. What's happening is that the entire book becomes a single XML instance, but one that is built from a series of 'entities'. The XML file that is produced will include an entity definition and matching entity reference for each of those files with the strange extension. One entity per book component. Despite the apparently odd output, if the source book was valid, then the XML output should be valid too.
The unusual extension is used to avoid file name collisions. No two files could ever have the same name using this method, also it's best not to name them .xml because the unstructured generated files will never be well formed XML.
One way to get the XML into a single file, rather than the separate entity files is to apply an XSLT transformation on the output. XSLT always resolves entities, so the end result is one much larger XML file. The XSLT only has to provide the most basic identity transform to work its magic.
Here's a small example of the results:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE book SYSTEM "file:///C:/Test/Application/TestFM.dtd" [
<!-- Begin Document Specific Declarations -->
<!ENTITY bkc1 SYSTEM "preface1.e01">
<!ENTITY bkc2 SYSTEM "Chapter1.e02">
<!-- End Document Specific Declarations -->
<book xml:lang = "en"
xmlns:xlink = "http://www.w3.org/1999/xlink">&bkc1;&bkc2;</book>
On lines 06 and 07 we see definitions for the entities bkc1 and bkc2 which map to the XML fragments preface1.e0 and Chapter.e02 repectively. Then on line 13 we see the entity references which tell us where the entities should be placed in the complete XML instance.
Let me know if you need any more guidance on any of this.
p.S. This thread will probably be moved to the Structured FrameMaker forum by the moderators.
Thank you Ian. Your explanation made sense of what I was observed while trying to make the conversion using the GUI.
My goal is to produce a full XML document. Now, I have a sample book which produces the example you listed. In my case, Line 13 produces many instances of the entities. What should I be troubleshooting if I am unable to have those entity references resolved?
I've always found this type of XML output to be remarkably robust. It's vary rare for it to fail completely. However it is possible for some of the entities to contain content that is not well formed. Unstructured content from a table of contents or an index should be avoided and you can prevent their output using a suitable Read/Write rule.
Are you familiar with the structapps.fm file and XML Application definition?
I am not familiar with those files. I am still getting my feet wet... 🙂
Part of understanding of FrameMaker will hopefully direct me to how to perform the same actions through the FM API using the FDK in C/C++.
To learn about the entire XML application definition process please have a look at the Structure Application Developer's Guide and Reference documents. You can find the current versions here:
You may also want to look at ExtendScript as a good way to get started with manipulating the FrameMaker object model. Almost everything in ExtendScript for FrameMaker matches the FDK. I started using it as a rapid development environment to test concepts, but found it every bit as good as the equivalent FDK client what I wanted to do.
Thank you. I will look at those references and the forums because I am on a limited schedule.
I have a question about ExtendScript but I will look to post it in the correct forum.