Re: Use ampersand character in setText

Grzegorz <[email protected]>
Newsgroups gmane.comp.java.jdom.general
Message-ID <CA+DoOicAPcUvmMygu+sRz07n_KpkWTtVhazJQN9znAao=hoxuQ@mail.gmail.com>
>
> according to Jdom FAQ ( http://www.jdom.org/docs/faq.html#a0290 ) , I
> tried to write the string
>
> &test
>
> using this statement:
>
> root.setText("\u0026test");
>
> where \u0026 is the Unicode code for ampersand character.
>
> The output is:
>
> &amp;test
>
> Where is the error ?
>

There is no error. What is wrong? It is a special character in XML and as
such it must be escaped.

Regards,
Grzegorz

_______________________________________________
To control your jdom-interest membership:
http://www.jdom.org/mailman/options/jdom-interest/[email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.