cancel
Showing results for 
Search instead for 
Did you mean: 

Xml File processing

Former Member
0 Kudos

Hi guys,

Can anyone tell how to process XML File.In my scenario i am creating a module in which i should replace some of the text in xml file. So in java how can i access attributes and corresponding data of the XML File. I have to replace the data of an attribute in that XmlFile.If anyone have good document links or code for that,plz send it.I would be very thankful.

Regards,

Gowtham K.

Accepted Solutions (1)

Accepted Solutions (1)

former_member182372
Active Contributor
0 Kudos

Hello Gowtham,

You need Java API For XML Processing (JAXP) (http://java.sun.com/webservices/jaxp/docs.html http://help.sap.com/saphelp_webas630/helpdata/en/36/ef353e39011a38e10000000a114084/frameset.htm). For example you can use SAX. What you need is to implement ContentHandler. As example you can use this http://java.sun.com/j2ee/1.4/docs/tutorial/examples/jaxp/sax/samples/Echo01.java

To replace some text inside element you should change implementation of characters(char[] buf, int offset, int len) method in mentioned example.

Best regards, Maksim Rashchynski.

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

Thank u Maksim Rashchynski.

Regards,

Gowtham K