Menu

#4 XML Marshaler needs to properly handle "]]>" in strings

open
2
2005-11-10
2005-11-08
Brad Koehn
No

To preserve formatting, the marshaler encodes data in a
CDATA block. If the block contains the CDATA end tag
"]]>", the data should be encoded thusly:

Source data: Hello]]>World

Marshaled data: <![CDATA[Hello]]>]]&lt;<![CDATA[World]]>

Simply split the source text on "]]>", and encode each
chunk in a CDATA, separated by a text node containing
"]]>". Need to see if this is what dom4j does on the
Java side.

Discussion

  • Brad Koehn

    Brad Koehn - 2005-11-09

    Logged In: YES
    user_id=434073

    Fixed. Added necessary splitting code in both Java and
    Javascript marshalers. Test splits at the beginning, middle,
    end, and sole positions in Strings.

     
  • Brad Koehn

    Brad Koehn - 2005-11-09
    • status: open --> closed
     
  • Brad Koehn

    Brad Koehn - 2005-11-09

    Logged In: YES
    user_id=434073

    Code correctly handles a single CDATA terminator in the
    source text, but needs to also handle multiple terminators
    in sequence.

     
  • Brad Koehn

    Brad Koehn - 2005-11-09
    • status: closed --> open
     
  • Brad Koehn

    Brad Koehn - 2005-11-10
    • priority: 5 --> 2
     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.