wood burning stoves 2.0*
The moose likes XML and Related Technologies and the fly likes problem parsing xml string using dom parser Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "problem parsing xml string using dom parser" Watch "problem parsing xml string using dom parser" New topic

problem parsing xml string using dom parser

Balamurugan Sundararajan

Joined: Jul 31, 2003
Posts: 2
i want to parse a Xml String using a Dom parser......the parse function in dom parser takes only input stream as argument.......so i made the code as
InputStream inputstream = new StringBufferInputStream(XmlData) ;
InputSource inputSource = new InputSource(inputstream );
but saxexception is coming and also warning called
"java.io.StringBufferInputStream in java.io has been deprecated"
Balaji Loganathan
author and deputy

Joined: Jul 13, 2001
Posts: 3150
I have tried it but see wheether it can take StreamSource

javax.xml.transform.stream.StreamSource xmlSource=new javax.xml.transform.stream.StreamSource(new StringReader(new String(inputXML)));

Spritle Software Blogs
Swarup Kumar

Joined: Aug 05, 2003
Posts: 1
StringBufferInputStream class does not convert properly character into bytes.Instead use StringReader class.
I agree. Here's the link: http://aspose.com/file-tools
subject: problem parsing xml string using dom parser