logo       

Re: international signs and entitys: msg#00044

java.enhydra.xmlc

Subject: Re: international signs and entitys

On Wednesday 29 October 2003 14:14, Thorsten Möller wrote:
> Hello!
>
> I don't know wheter it is a bug or what I want is not supported, but
> international signs should be replaced in the following code with the
> corresponding entity:
>
> String text = "ü";
> node.getOwnerDocument().createCDATASection(text);
>
> After that the node should contain a text "ü" but this is not the
> case.

That's because you create a CDATA section. CDATA is specifed in XML to allow
arbitrary, unescaped data, so that is what XMLC puts in there.

HTML doesn't specify a CDATA section, but XMLC uses CDATA nodes in the DOM to
achieve the same effect: Insert arbitrary strings into the DOM that are not
changed by XMLC. This hack is sometimes useful to insert pre-existing HTML
into an XMLC document, but is not recommended for general use.

If you want XMLC to escape entities for you, use text nodes instead of CDATA
sections.

Hope this helps,

Richard
--
Richard Kunze

[ t]ivano Software, Bahnhofstr. 18, 63263 Neu-Isenburg
Tel.: +49 6102 80 99 07 - 0, Fax.: +49 6102 80 99 07 - 1
http://www.tivano.de

Attachment: pgpMxO7FRWMfE.pgp
Description: signature

<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise