Skip to main content
4everJang
Legend
April 24, 2014
Question

Can I pull prefixes/suffixes into XML ?

  • April 24, 2014
  • 1 reply
  • 1508 views

I am using prefix and suffix rules in my EDD to make things easier for the author (and standardize some headings and parts of names). Now I need to write the content into XML and my prefixes and suffixes do not get pushed into the content on the XML side. I do not find any reference to prefix and suffix in the read-write rules. Is there a way to let FM write the prefixes into either an attribute or the content of an element when writing to XML? I am not interested in round-tripping here, so even if the method is more or less destructive, I would be more than happy to know about it. The only other option I see is adding more work to the extendscript that I am using to prepare the materials for writing to XML.

Thanks

Jang

This topic has been closed for replies.

1 reply

Inspiring
April 24, 2014

Hi Jang,

I'm using something similar to display correct typographic quotation marks (instead of &quot), according to the language of the document.

To do this, I introduced the element <quote> with language specific attributes. This translates out properly into XML and also allows roundtripping (in regards of the translation process).

Maybe this could be the solution you seek. Simply introduce a new element <presuf> with an appropriate attribute for the pre/suffix and a switch attribute to declare if its a pre- or a suffix.

This also has the charm that you can handle all context rules for your suffixes and prefixes in one place in the EDD.

The second advantage of this is, that you always can use this element and attribute for processing with XSL.

-Alex

4everJang
4everJangAuthor
Legend
April 24, 2014

Hi Alex,

Thanks for the tip, but I don't think this will make my customer happy. Introducing a whole series of new elements instead of using FrameMaker's prefix and suffix options is going to clutter the structure. If I only have one <prefix> and one <suffix> element with attributes defining their content, I either need to edit the attribute value (which would have to be done for each individual <prefix> and <suffix> element in the document) or introduce as many different <prefix> and <suffix> element variants as the variable text I want to assign to them.

I am using a <variable> element to get rid of the limitations in FrameMaker variables, which are defined per chapter and require updating across all chapters. I want to keep the textual information in one spot: the book attributes. The <variable> element pulls the book attributes in via a context rule (which looks at the "item" attribute of the <variable>) and its prefix rules. Changing the "item" attribute immediately makes another prefix text appear. Changing the book attribute and updating the book makes all prefixes match the new book info. It is as elegant as I can make it - because of the context rules for the prefix.

In the meantime - as I did not expect there were any read-write rules for this case, I have created a 20-line extendscript to do what I need to do before writing the materials out to XML. I grab the current text in FM and paste it before the <variable> element, then delete the <variable>. As I mentioned, I do not need to roundtrip back from XML, which makes things a lot easier.

Kind regards

Jang

ScottPrentice
Inspiring
April 24, 2014

Hi Jang...

I'm not aware of any way to do that other than through scripting/plugin of some kind. However, I think that the "right" way to deal with this is to add the prefix/suffix addition into your XML publishing process rather than to include it in the XML. Your XSL scripts that generate output from the XML can add the prefixes/suffixes or if the output is HTML, you can use CSS to assign them.

Of course, the "right" way to do something isn't always the best way, so if you really need the strings hard-coded in the XML, I think you're on to the best solution.

Cheers,

...scott