Skip to main content
Participant
December 4, 2014
Question

Cross references in custom XML

  • December 4, 2014
  • 1 reply
  • 477 views

Hello!

We have a custom XML schema and a structured application that allows us to edit our XML documents in FM. The schema contains a definition for a cross reference element and a definition for a target element.

=============================================================

Example:

A cross reference element (say, documentA.xml contains this element): <cref target="documentB.xml#sect123"/>.

A target element (say, documentB.xml contains this element): <section id="sect123"/>.

Also I have a book in FM that includes both documentA.xml and documentB.xml.

=============================================================

FM outputs error messages when I try to save documentA.xml.

So, I have few questions concerning this issue.

How should I describe the cref element in EDD?

A manual says, that the @Target attribute must be of the IDREF type. Sounds good but the # char is restricted for IDREF values. How can I resolve this contradiction? If I write <cref target="sect123"/> (target id without filename) FM outputs error messages when I open documentA.xml in FM.

Thank you!

This topic has been closed for replies.

1 reply

Legend
December 5, 2014

Hi Michael,

Within FrameMaker, the ID of the source and the IDREF of the target should be the same. The target filename lives in the background as a property of the cross-reference object. It becomes exposed in the XML as part of the translation process, the behavior of which may depend on the setup of your structured application.

Have you read the information in the Structure Developers Guide yet?

http://help.adobe.com/en_US/FrameMaker/12.0/StructuredDev/Structure_Dev_Guide.pdf

There is good information starting on page 393, including a section specific to the syntax required when you are using XML schema for validation.

Russ

Participant
December 8, 2014

Dear Russ,

Thank you very much for the answer. I'm sorry for my replying you with a delay,

To make long story short, now it's OK: we can load a document with cross references to FM as well as we can save it form FM. Thank you once more.

I'd like to make some comments that might be useful for other readers of this forum.

As far as I understand the Structure Developers Guide mostly describes import/export transformations between an XML format and the FM format. But we never convert XML files to FM files and vice versa in our application. We open an XML file in FrameMaker, we edit the XML file in FrameMaker, and finally we save the XML file from FrameMaker. So, while reading the Guide I had a permanent doubt if import/export is the case I deal with.

After several probes and attempts we found out that the following format of cross reference is appropriate for our application:

<xref srcfile="fm-properties.xml#sys_psnt_part_number" format="CrossReference"/>


(We found this type of cross references on page 399 of the Guide).


The xref element must have an attribute of the IDREF type defined in a schema and in an EDD even while we don't use it. This attribute may actually be omitted in an XML file but we had to define it for xref.

The root element of a target XML document must have an attribute of the ID type even while we don't use it.

Legend
December 9, 2014

Hi Michael,

I'm glad you got it to work. One point of clarification... there is always a translation from XML to FM format, if you are authoring within FrameMaker (and not the code view). FrameMaker can't really open an XML file as-is. Once it is rendered in the WYSIWYG view, it has become a structured FrameMaker document just like any other that could be saved in *.fm format. So, all activity regarding FM <-- --> XML translations is applicable, in all cases. In other words, there is always an "import/export".

Russ