aspose file tools
The moose likes Beginning Java and the fly likes How to insert  brackets into an XML element value? Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Beginning Java
Reply Bookmark "How to insert  brackets into an XML element value?" Watch "How to insert  brackets into an XML element value?" New topic
Author

How to insert brackets into an XML element value?

Ong CherYee
Greenhorn

Joined: Jan 17, 2008
Posts: 10
If I have a <file> </file> element in an XML file and I want to insert a filename of the form PED<yyMMdd>232, how do I insert the < and > brackets as an element value inside the <file> tag?

I use JCreator to edit the xml file and it treats <yyMMdd> as a seperate element instead of being part of the filename.

Nitesh Kant
Bartender

Joined: Feb 25, 2007
Posts: 1638

Escape < with &lt; and > with &gt;


apigee, a better way to API!
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 35241
    
    7
Or you can use a CDATA section.


Android appsImageJ pluginsJava web charts
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to insert brackets into an XML element value?
 
Similar Threads
Need help in modifying XML text value using DOm parser
XML HELP... Sigh..
xml, dtd, and parsing code
Query about jDOM.
Navigation of XML records