Generating xml file with "&" using java -


i need write <name> dolce & gabanna </name> in xml file using java. however, gets generated <name> dolce &amp; gabanna </name>.

is there method can use in java "&" displayed in xml, instead of "&amp;"?

thanks.

i need write <name> dolce & gabanna </name> in xml file using java.

no, don't. not unless you're trying create invalid file. whatever code you're using doing right thing - xml parser reading file unescape &amp; & appropriate.

from xml 1.0 specification, section 2.4:

the ampersand character (&) , left angle bracket (<) must not appear in literal form, except when used markup delimiters, or within comment, processing instruction, or cdata section. if needed elsewhere, must escaped using either numeric character references or strings " &amp; " , " &lt; " respectively.


Comments

Popular posts from this blog

How has firefox/gecko HTML+CSS rendering changed in version 38? -

javascript - Complex json ng-repeat -

jquery - Cloning of rows and columns from the old table into the new with colSpan and rowSpan -