on 10-27-2005 1:43 PM
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.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Thank u Maksim Rashchynski.
Regards,
Gowtham K
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
91 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.