Skip to main content
November 20, 2012
Question

How can I get XML cross-references to translate to Structured FrameMaker?

  • November 20, 2012
  • 1 reply
  • 2542 views

I've been using Structured FrameMaker from the beginning, and have designed many EDDs, and about 10 years ago I did some translation of SGML into Structured FrameMaker (7.2) which worked well.

Now, (with FrameMaker 10), I've had to design an EDD to translate XML documents into Structured FrameMaker.

In my EDD I've a CrossReference element called XRef; this has an attribute of ID, which in turn has a value of IDReference and has Special AttributeConrols of ReadOnly.

My target elements in the EDD all have an ID attribute with a value of UniqueID.

My XML document's target xref element has  an attribute of linkend, and in XML this works as I'd expect.

When I pass the XML file through the EDD/Template, everything works except that I get an ID = no value, which, of course, results in no display of the cross-reference data in the document.

Oddly, in structured FrameMaker, my element of link, with an attribute of linkend, works as it should, and displays the data.  It may not be important, but the value for linkend is IDReference not UniqueID, and this displays correctly (I changed this attribute's value to Unique ID in my EDD and it made no difference to the XRef value in my document).

After making all these EDD changes, I've been careful to save the changes, import them to all files in my book and finally update the book.   Everything hangs together - except, of course, that the cross-reference doesn't work.

I'd sincerely appreciate any help or advice other users might have because I'm quite frankly stumped.

This topic has been closed for replies.

1 reply

Van Kurtz
Inspiring
November 20, 2012

Chris,

I believe you have to use read/write rules to translate the XML attribute linkend to the FrameMaker EDD attribute ID.

attribute "linkend" is fm attribute "ID";

See the Structured Application Guide that comes with FrameMaker.

Van

Participant
November 21, 2012

Van,

Sorry, didn't know the etiquette with forums (I'd already replied to your e-mail).  For completeness, here's what I said:

I already have linkend as an attribute of element link (which works and displays properly).

Changing my r/w rules as you suggested doesn't, unfortunately, change anything.

There is the other thing with the r/w as they come with FrameMaker, in that xref shows its attributes as properties of element "xref"; so, following what you suggest, I'd need to declare (under xref):

attribute "linkend is fm property cross-reference id

I'd already tried that but with no success (I don't think internal to element xref, that I need to say cross-reference "id").

This looks like something specific to the xref element, as opposed to the general purpose ID attribute which appears in pretty well all of our elements for, eh, cross-references purposes.  In Structured FrameMaker a legally inserted xref element works correctly, it's just the translation from XML that's causing the problems.

Too, I'm guessing the bit about linkend above is also affected by the earlier listing in the r/w rules:

attribute "id" is fm attribute "ID"'

At the moment, in the description for the xref element I have:

attribute "linkend" is fm property cross-reference ID.

I even saw one note on the web which suggested that departments doing what we're trying to do should just go ahead and re-enter cross-references in the resultant Structured FrameMaker book.  A pretty hopeless task given that our books are often many chapters long with hundreds of pages and who knows how many cross-references.  This is taking no account of the human-error side of such an undertakaing.

We've not given up hope yet; but thanks for your help, and I'm sorry what you suggested didn't work.

Regards

Chris

Legend
November 21, 2012

Hi Chris,

I think you should be able to get some help here to get this fixed. For me, though, I need some more clarification, which may help me or somebody else figure this out.

First of all, it seems odd to me that you have an IDReference attribute named "ID". Perhaps there is no problem with that, but then again, perhaps there is something funny going on, since apparently you are using the same attribute elsewhere as a unique ID. Did you consider renaming this to IDRef or something like that? Or, what would be the problem with just keeping the name as "linkend", since this seems to be working with another element called <link>, right? Occasionally, although it is very bad, FM will exhibit hardcoded behavior with respect to certain element and attribute names, overriding anything that you try to customize.

Secondly, you say you have the following rule for <xref>:

attribute "linkend" is fm property cross-reference ID.

I've never tried to do what you are attempting, but it seems that this one rule could be insufficient. You are trying to do two things:  1) Tell FM that the 'linkend' is the xref ID and 2) that the resolved IDRef value should populate 'ID' in the FM document, not 'linkend.' So, it appears to be a bit of a tall order, if that one rule doesn't work. One would think that FM would be able to figure it out, since you can only have a single IDRef attribute on an element, right? But, having said all that, I don't know what else you could do with the rules. Van suggested this:

attribute "linkend" is fm attribute "ID";

...but I'm not sure if that is the right approach, since we aren't talking about a direct transition of a value from one attribute to another. This is a case where a property needs to be resolved to make an FM object (ie, an xref) work. So, it doesn't surprise me that it didn't work, although it was a worthy suggestion.

Thirdly, you didn't mention if you are using a DTD or schema with your structured app (I assume you have all this set up). There are special ways that you have to declare cross-reference elements in each, otherwise some things just don't work right. Have you explored any changes in this area?

Here's one thing I can suggest which I'm pretty sure will solve the problem... a simple XSLT stylesheet. If you are convinced that there is no problem with using an attribute named 'ID' as an IDReference, it would be quite simple to invoke a simple stylesheet upon import that renames all 'linkend' attributes on <xref> elements to 'ID'.

It does seem, though, that you should be able to solve this with read/write rules and DTD/schema setup. Without the ability to experiment directly, I don't have any additional ideas at the moment.

Russ