Copy link to clipboard
Copied
Good morning,
I've successfully gotten my FrameMaker XML application running and exporting millions and millions of lines of data. I was SO excited to be able to do this completely on my own (and with several of you!)
But, we transferred the data to our vendor who is creating a search engine for us and they ran across a problem that they (as non-FrameMaker users) and I (not really an "XML" person) can't figure out. I will paste in below what they said is happening, vs. what should be happening and see if yall can help? I hope this is an easy one since we are getting to a serious deadline. Their email to me:
The problem is that FrameMaker is assigning graphic entity names to the graphics on export, but it is not putting out the associated entities that complete the map.
Here is an example:
<graphic>
<sheet>
<graphicobject entity="graphicobject1" impsize="6.760in 7.063in" impby="ref" sideways="0" impang="0.000" xoffset="0.188in" yoffset="0.076in" position="below" align="aleft" cropped="0" float="0" width="7.135in" height="7.216in" angle="0.000" nsoffset="0.000in"/>
<title>Engine Change Check List (Page 1 of 2)</title>
</sheet>
</graphic>
<graphic>
<sheet>
<graphicobject entity="graphicobject2" impsize="6.756in 7.012in" impby="ref" sideways="0" impang="0.000" xoffset="0.247in" yoffset="0.089in" position="below" align="aleft" cropped="0" float="0" width="7.250in" height="7.191in" angle="0.000" nsoffset="0.000in"/>
<title>Engine Change Check List (Page 2 of 2)</title>
</sheet>
</graphic>
Note that the red bold stuff is the Frame assigned logical name for the graphic. The actual entities are usually output with the document, and the entities describe the format and location of the graphics. An example mught be similar to:
<entity graphicobject1 “c:\myfolder\somewhere\mygraphic.tif”>
<entity graphicobject2 “c:\myfolder\somewhere\mygraphic.tif”>
Without the entities we have no idea what the actual graphic file is being referred to in the xml.
Anyone know what is causing this? Maybe something I need to declare in the application or read/write rules??
Thank you as always,
Lyncca
Lyncca,
I do not normally export to XML, but I have played around with it to see what is involved. In my read/write rules, I have the following:
element "Graphic" {
is fm graphic element;
attribute "file" is fm property file;
}
This tells FrameMaker that the file attribute of the Graphic element is to hold the FrameMaker property file, which is the location of the graphic file. On XML output, this generates something like the following:
<Graphic
file = "../../../WS-0656.eps"
impsize = "3.
Copy link to clipboard
Copied
Lynnca,
Are you using XSLT in your FrameMaker XML application?
If so, then you have to re-create the doctype statement and the entity declarations as a part of the XSLT processing.
If you are not using XSLT then I have no idea why this would happen.
Regards
Ian
Copy link to clipboard
Copied
Lyncca,
I do not normally export to XML, but I have played around with it to see what is involved. In my read/write rules, I have the following:
element "Graphic" {
is fm graphic element;
attribute "file" is fm property file;
}
This tells FrameMaker that the file attribute of the Graphic element is to hold the FrameMaker property file, which is the location of the graphic file. On XML output, this generates something like the following:
<Graphic
file = "../../../WS-0656.eps"
impsize = "3.329in 2.537in" impby = "ref" sideways = "0"
impang = "0.000" xoffset = "0.000in" yoffset = "0.083in"
position = "below" align = "aleft" cropped = "0" float = "0"
width = "3.973in" height = "2.636in" angle = "0.000"
nsoffset = "0.000in"/>
The XML output has no entity statements in it.
Van
Copy link to clipboard
Copied
Lyncca,
FrameMaker does declare the entities in the header of the basic XML file.
But I always use the method Van is recommending, just one addition: You have to make sure that the external DTD does not contain an attribute "entity".
- Michael
Copy link to clipboard
Copied
Lyncca,
I have just discovered that FrameMaker does not write the entity references if there is no DTD defined in your XML application definition which is in the structapps file. Add the DTD reference and everything should work as expected.
This looks like a bug to me as an entity attribute with no corresponding entity declaration is of no use to anyone. I would have expected FrameMaker to output a file attribute if no DTD is specified...
I hope this helps
Ian
Copy link to clipboard
Copied
Some other considerations on graphic and file entities:
1) When a DTD defines both file and entity attributes (as does DocBook, for
example), FrameMaker always uses the entity attribute for export.
2) Read/write rules can change the attribute names for these purposes.
3) In the absence of rules that change the entity name associated with
these properties, FrameMaker assumes that an attribute named file is used
for the file name and one named entity is used for the entity name. You can
change this behavior with the rules:
attribute "file" is fm attribute;
attribute "entity" is fm attribute;
4) If you want to be able to import both file and entity attributes but
export only a file attribute, use different applications for import and
export. Add the second rule above to the export application.
--Lynne
Lynne A. Price
Text Structure Consulting, Inc.
Specializing in structured FrameMaker consulting, application development,
and training
lprice@txstruct.com http://www.txstruct.com
voice/fax: (510) 583-1505 cell phone: (510) 421-2284
Copy link to clipboard
Copied
Thank you for all the helpful feedback. I've been out of the office on vacation.
I think we are definitly on the right track for correcting this.
Ian, I am using pre and post processing XSLT stylesheets. The problem is that I don't know XSLT. These were written by a consultant that is no longer with us. I do have a DTD declared in the application.
I added the graphic element to the read/write rules and it seems to be working. I will send my vendor an output and see if that is what they need.
I really appreciate yalls help and will come back and answer either way if it corrected the problem in case someone else has the same problem in the future.
Copy link to clipboard
Copied
Lyncca,
Are you getting entity declarations in your XML now? The part that may still be missing should be at the top of the XML file and will look similar to this:
<!DOCTYPE doc SYSTEM "{path to DTD here}" [
<!ENTITY graphicobject1 SYSTEM "gr001.cgm" NDATA cgm>
<!ENTITY graphicobject2 SYSTEM "gr002.cgm" NDATA cgm>
]>
In this example I have used doc as the doctype yours will probably be something else.
When XSLT is used as it is in your XML application, the doctype declaration and any entity declarations have to be specifically recreated.
Regards
Ian
Copy link to clipboard
Copied
Ian,
I've been thinking about this since you wrote it and I am still wondering... how could you recreate these entity declarations? Is there a way to do it based on the original file, or would you somehow need to hardcode this in a stylesheet? I guess I'm trying to milk some XSLT tips out of you here I don't know how to read data from this area of an XML file using XSLT.
Russ
Copy link to clipboard
Copied
Hi Russ,
The way I do it is to make some assumptions based on the file name of the graphic.
That's about it, you can find an example of this in Adobe's S1000D application pack that is available for download here: http://www.adobe.com/support/downloads/detail.jsp?ftpID=4247
Ian
Copy link to clipboard
Copied
Thanks Ian. That is certainly a bit of complexity just to enjoy some XSLT during roundtripping. I see how it is done but I think I'll just hope that I never have the need to do it.
Russ
Copy link to clipboard
Copied
Ok, in this case, adding the Read/Write rules did correct the graphic path.
Thanks again for your help!