You are viewing a plain text version of this content. The canonical link for it is here.
Posted to soap-dev@xml.apache.org by Nathan Wray <nw...@mich.com> on 2000/10/15 14:40:47 UTC

Re: Passing a String with XML

This seems like a genuine concern, would it be appropriate to add tag escaping to String serialization?  It could operate similar (or identical to) URL escaping, i.e. replace all "<" with "%3c" and ">" with "%3e" (and escaping natural %'s with "%25").



chuck clark wrote:

> i posted earlier this week with a question of how to encode a string so
> that it would not be analyzed by the DOM when being passed because i had
> a case where my string was XML which might or might not have been valid
>
> i never found a real answer...it did appear that as long as the XML was
> well-formed it would pass through cleanly until i had a fragment which
> contained a CDATA section
>
> it was in a proper CDATA block like <![CDATA[<myXMLTag>blah
> blah</myXMLTag>]] but i would get an error saying myXMLTag must be
> predefined....so i continued to search for a way to get around this
>
> i found the easiest was to call getBytes() on my String and set my
> parameter type to be byte[].class instead of String.class then in the
> object being called i just do new String( byteArrayParameter ) and
> continue on..the string gets Base64Encoded/Decoded automatically on the
> wire and slips by the bit that was choking before....not an elegant
> solution but a bandaid none-the-less until the problem gets fixed...
>
> if anyone learns the proper way i'd appreciate seeing a post here
>
> cheers
> chuck

--
Nathan Wray
nwray@mich.com
--
"Our attitudes control our lives. Attitudes are a secret
power working twenty-four hours a day, for good or bad. It
is of paramount importance that we know how to harness
and control this great force."

        - Tom Blandi