File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

passing XML as string to parser method.

 
Pooja Agarwal
Ranch Hand
Posts: 37
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1953
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How about a StringReader?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic