简体   繁体   中英

remove escape characters from XML string in java

I have inout XML with following format

<Some_tag>
   <childTag>this is >25000</childTag>
</Some_tag>

the actual XML is very big with +200KB. I am reading this XML in Java. I am getting it as String.

What is solution to remove those > (Special char/escape char) from Tag values?

Use XSLT try something like this

XSLT to remove chars

Or use jaxb move all the xml to beans and remove the non needed chars from the String properties.

XML should be like

&lt;Some_tag&gt;
   &lt;childTag&gt;this is &gt;25000&lt;/childTag&gt;
&lt;/Some_tag&gt;

easy to parse your parser easily convert &lt; to < and &gt; to >

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM