Function to escape xml control characters in a string

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Function to escape xml control characters in a string

Frank Sonnemans-3
Does anyone have a method which escapes xml control characters from a
text string. I need to store some data in xml, but unfortunately it
contains < and > characters which are interpreted by the xml viewer as a
tag start/end.

Regards,


Frank


Reply | Threaded
Open this post in threaded view
|

Re: Function to escape xml control characters in a string

Panu Viljamaa-3
Store the string inside a PCDATA section within your XML
-Panu

Frank wrote:

> Does anyone have a method which escapes xml control characters from a
> text string. I need to store some data in xml, but unfortunately it
> contains < and > characters which are interpreted by the xml viewer as a
> tag start/end.
>
> Regards,
>
> Frank


Reply | Threaded
Open this post in threaded view
|

Re: Function to escape xml control characters in a string

Panu Viljamaa-3
Sorry,
What I meant to type was "CDATA" (= Character data), not "PCDATA" (= Parsed
Character data). Within a CDATA section the markup characters such as '>' and
'<' are left unparsed.

-Panu


Panu Viljamaa wrote:

> Store the string inside a PCDATA section within your XML
> -Panu
>
> Frank wrote:
> > Does anyone have a method which escapes xml control characters from a
> > text string. I need to store some data in xml, but unfortunately it
> > contains < and > characters which are interpreted by the xml viewer as a
> > tag start/end.
> >
> > Regards,
> >
> > Frank


Reply | Threaded
Open this post in threaded view
|

Re: Function to escape xml control characters in a string

Frank Sonnemans-3
Thanks that solved my problems.

Regards,

Frank

Panu Viljamaa wrote:

> Sorry,
> What I meant to type was "CDATA" (= Character data), not "PCDATA" (= Parsed
> Character data). Within a CDATA section the markup characters such as '>' and
> '<' are left unparsed.
>
> -Panu
>
>
> Panu Viljamaa wrote:
>
>
>>Store the string inside a PCDATA section within your XML
>>-Panu
>>
>>Frank wrote:
>>
>>>Does anyone have a method which escapes xml control characters from a
>>>text string. I need to store some data in xml, but unfortunately it
>>>contains < and > characters which are interpreted by the xml viewer as a
>>>tag start/end.
>>>
>>>Regards,
>>>
>>>Frank
>>>
>