Skip to main content
Inspiring
December 17, 2009
Question

Cross-reference between structured and unstructured FM documents

  • December 17, 2009
  • 5 replies
  • 1284 views

Hello,

Is it possible to retain FM cross-references from structured to unstructured FM documents during an XML round trip?

From what I know, cross-references between or inside structured documents form pairs of ID and IDREF, while cross-references to unstructured documents are dumped as normal text and lose their functionality.

The unstructured target documents might be converted to Structured FM at some point, but for the time being I'd like to find another solution. Do you know any solution to this?

Thanks,

Johannes

This topic has been closed for replies.

5 replies

Participant
June 3, 2013

Johannes,

I am having similar issues as you in which I would like to store a non-element based cross-reference in the XML file.

Did you ever find a solution to this problem? Any guidance would be appreciated.

Trevor

Inspiring
January 4, 2010

Thanks to all of you for your replies so far, and my apologies for not checking back earlier, my christmas break began early ...

Michael, I do not intend to discard the structure from the one document that is structured already, but would like to end up with an actual XML roundtrip in the way you describe it, i.e. save XML and import it again (with additional content, metadata or whatever). The only unstructured parts involved are the target documents for a significant number of cross-references.

Rather than developing an API client (which I cannot do myself) I've come up with an idea that involves reading the MIF file and writing the FM-unstructured-only cross-reference targets as attributes to XML. I'll give that a try as soon as I have some time and will report back if it works. This seems to be a job for an XSLT2 transform (because I'll need the unparsed-text function).

Johannes

Michael_Müller-Hillebrand
Legend
December 17, 2009

Johannes,

going from structured files to unstructured and maybe later back to structured files is not what was originally meant, when the term "XML roundtripping" was coined. XML roundtripping means to save a structured FrameMaker book/document to XML and being able to open it with FrameMaker (most probably after text translation) with all original features retained. This is sometimes a challenge itself, but entirely possible.

Why would you want to loose the "technical quality" that is in structure documents anyway?

I second the remarks regarding the fundamental difference between structured (element + id based) and unstructured (paragraphs + cross-ref markers) cross-references mentioned above.

Schöne Grüße,

- Michael Müller-Hillebrand

Legend
December 17, 2009

Johannes,

Without custom programming, I would think not. The ID/IDRef attribute link is normally the only thing in the XML that defines the source and target. I notice that when I insert a paragraph-based xref, I predictably don't get the IDRef attribute populated on the xref element. When I save the XML, the element is dropped entirely. So in summary, I'm not the foremost expert on any obscure options you might have, but my strong suspicion is that you won't be able to do it without a custom import/export API client. Even if you did get some kind of markup to export, I don't see how you could possibly recreate a paragraph-based xref on import.

Russ

Van Kurtz
Inspiring
December 17, 2009

Johannes,

This is just a guess, because I do not do this.

First, of course, you cannot export the unstructured file to XML, because it is unstructured.

Second, IF the cross-reference from the structured file to the unstructured file were done via your cross-reference ELEMENT, then the cross-reference element should export to XML as an XML element with one of its IDref attribute set to the ID of something in the unstructured file. When you open the XML file in FrameMaker, the cross-reference is re-established.

In other words, when exporting to XML, FrameMaker does not care to what you are referencing. It just converts the cross-reference element into an element with an attribute in the XML file. So, it should work as expected when opened in FrameMaker. Of course, I am assuming your read-write file is set up to handle cross-references.

On the other hand, IF you are creating your cross-reference from the structured file by simply inserting a cross-reference, that is NOT as an element, then I do not know what happens. If it is being exported as text, then I am not sure FrameMaker will know what to do with it when you reopen the XML file.

Hope this helps,

Van