Meaningless Drivel is fun!*
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
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
Author

problem parsing xml string using dom parser

Balamurugan Sundararajan
Greenhorn

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
Bartender

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
Greenhorn

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