• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Preserving cross-references to/from XML - again

New Here ,
Jul 17, 2019 Jul 17, 2019

Copy link to clipboard

Copied

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.

xref_1.png

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>).

xref_2.png

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.

xref_3.png

Where should I be looking for what I'm doing wrong?  Is it the missing attribute from when I did the conversion?

Thanks,

Jed

TOPICS
Structured

Views

609

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Advisor , Jul 17, 2019 Jul 17, 2019

Jed,

  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.

--Lynne

Votes

Translate

Translate
Advisor ,
Jul 17, 2019 Jul 17, 2019

Copy link to clipboard

Copied

Jed,

   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.

     --Lynne

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jul 17, 2019 Jul 17, 2019

Copy link to clipboard

Copied

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.

Thanks again,

Jed

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advisor ,
Jul 17, 2019 Jul 17, 2019

Copy link to clipboard

Copied

Jed,

  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.

--Lynne

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jul 18, 2019 Jul 18, 2019

Copy link to clipboard

Copied

LATEST

Hi,

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines