wood burning stoves 2.0*
The moose likes XML and Related Technologies and the fly likes passing  XML  as string to parser method. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "passing  XML  as string to parser method." Watch "passing  XML  as string to parser method." New topic
Author

passing XML as string to parser method.

Pooja Agarwal
Ranch Hand

Joined: May 19, 2004
Posts: 37
Hai All

I have got a small problem here.
I am getting an XML file as a string from Java client to my sevlet.
I need to parse the string. But SAX parser takes URI as input and not string directly. It also has an overloaded method which takes Inputsource as an input. (i.e it can take a character stream, a byte stream).
Let me know if there is a way to convert String to character stream, or a byte stream) OR any other way to parse the string directly.

Any help regarding this would be appreciated.
Thanks in advance
Pooja.
Roseanne Zhang
Ranch Hand

Joined: Nov 14, 2000
Posts: 1953
How about a StringReader?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: passing XML as string to parser method.
 
Similar Threads
problem parsing xml string using dom parser
JAX-RS : A Way to Serialize String to XML as a Response?
[DOM] - Problem reading xml data inputStream for parsing.
Parsing RSS2.0 feeds using XML Pull Parser
Default XML parser: SAX or DOM?