*
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 | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Beginning Java
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: 11
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: 41052
    
  43
Or you can use a CDATA section.


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