I can't get an external cross reference to appear in my XML. I think I'm doing everything discussed in the discussion "Preserving cross-references to/from XML", but I must not be. I start with an unstructured document with a cross reference to another document.
I structure the document using a conversion file and EDD I imported into the template and the cross reference appears successfully in the GUI (but there's no ID attribute, Idref = <no value>).
When I export the XML, there's no source file or ID for external cross references, but the internal cross references are getting saved in the XML.
Where should I be looking for what I'm doing wrong? Is it the missing attribute from when I did the conversion?
Unfortunately, you will have to convert external cross-references yourself using some combination of XSLT, the FDK, Extend Script, or (shudder) manual editing.
Even if you use the Structure > Utilities > Structure Current Book command to structure all files in a book, FrameMaker applies the specified conversion table one file at a time. Therefore, when it is processing the file containing a cross-reference, it does not have information about the elements and attributes in the external file or its eventual structured counterpart.
Thanks for the super-fast reply Lynne.
I can figure out a solution with ExtendScript or XSLT,
I just want to confirm a couple things.
No matter what, from a structured .fm file, I can't directly get the external source file pointers into the saved XML?
And instead, the only place I'll be able to insert pointers to the source files is by modifying the XML afterward after I've saved it (using XSLT or another method), or, in FM (using ExtendScript, or manually) after I've imported the XML back in? Then, from that point, the source file pointers will be preserved during round-tripping.
If by "directly" you mean without some type of programming or scripting, you are correct; FM does not provide a command that generates the ID reference for a cross-reference to an external file.
I often use XSLT to change the structure created by a conversion table for other reasons as well. I may have one DTD for saving the conversion table output as XML and another for the final structure.
In one of my iterations during conversion, I found that I was able to export XML with an external cross reference from a structured FM document after all. The problem I was having before was that I was trying to set a cross reference to a paragraph instead of an element. In reading more forum entries, I'm seeing this was a pretty basic mistake - I'm still learning.
This was not correct, in the way I interpreted what I was trying to say: "No matter what, from a structured .fm file, I can't directly get the external source file pointers into the saved XML"
That is, this didn't work.
But this will create a srcfile attribute in the XML when the structured .fm file is saved as XML.
It would be a (pretty significant) manual effort to fix all the broken cross references from the converted documents using the GUI this way.