Skip to main content
Legend
August 16, 2013
Answered

Workaround for ]]> XML export bug with schema?

  • August 16, 2013
  • 1 reply
  • 1355 views

Hi,

It is a known issue that the ]]> sequence will not export properly to XML. If you are using a DTD, there is an entity-based workaround that is described here:

http://forums.adobe.com/message/3774389

The question... is there a workaround when using schema? I'm unable to figure it out.

Thanks,

Russ

This topic has been closed for replies.
Correct answer Lynne A. Price

Russ,

   You are working in an environment where FM exports incorrect XML, so you need to find the best possible compromise for your situation. I assume you want to have the most accurate appearance in FM as well as correct XML. Possibilities include:

1. Adding a DTD to the environment. Your original question asked about using a schema instead of a DTD. Can you convert the schema to a DTD, for use only in FM import/export? You can remove references to the DTD with XSLT.

2. Using an empty element to insert this string as a prefix/suffix. You said it is not practical to add such an element.

3. Changing the string by inserting a space between the two square brackets or before the closing angle bracket. If you use a thin space in FM, the result might look almost correct, but the XML will not be. Again, you can correct it in XSLT.

4. Wrapping a do-nothing element around part of the string (for example, "<ph>]</ph>]]>")

  Does your application involve a custom client? Or can you invoke an FDK client or script while saving to XML or opening XML? If so, your writers can enter the unmodified string in the FM documents, and the client or script can change it on the way out, with XSLT again cleaning up the result if necessary.

  Good luck.

          --Lynne

1 reply

Inspiring
August 16, 2013

Russ,

    Hmmm. Best I can come up with a couple minutes thought is to use a new empty element on the FM side with ]]> as a prefix or suffix. You can convert between the element and the string with XSLT if you just want the string in XML.

  Of course, then you need to train writers editing in FM to insert the element instead of typing the characters. They can do a global Find/Change if they forget and then run into problems.

          --Lynne

Russ WardAuthor
Legend
August 19, 2013

Hi Lynne,

Thanks for taking the time to answer. Altering the structure definition is not really a good option, so I guess I'm stuck. I just stick an extra space in there for now, which of course makes the XML sample technically invalid. Seems that it would be an easy fix for Adobe, but we'll see.

Thanks,

Russ

Lynne A. PriceCorrect answer
Inspiring
August 19, 2013

Russ,

   You are working in an environment where FM exports incorrect XML, so you need to find the best possible compromise for your situation. I assume you want to have the most accurate appearance in FM as well as correct XML. Possibilities include:

1. Adding a DTD to the environment. Your original question asked about using a schema instead of a DTD. Can you convert the schema to a DTD, for use only in FM import/export? You can remove references to the DTD with XSLT.

2. Using an empty element to insert this string as a prefix/suffix. You said it is not practical to add such an element.

3. Changing the string by inserting a space between the two square brackets or before the closing angle bracket. If you use a thin space in FM, the result might look almost correct, but the XML will not be. Again, you can correct it in XSLT.

4. Wrapping a do-nothing element around part of the string (for example, "<ph>]</ph>]]>")

  Does your application involve a custom client? Or can you invoke an FDK client or script while saving to XML or opening XML? If so, your writers can enter the unmodified string in the FM documents, and the client or script can change it on the way out, with XSLT again cleaning up the result if necessary.

  Good luck.

          --Lynne