aspose file tools*
The moose likes Java in General and the fly likes Writer to InputStream or source Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Writer to InputStream or source" Watch "Writer to InputStream or source" New topic
Author

Writer to InputStream or source

Adam Teg
Ranch Hand

Joined: Jul 10, 2007
Posts: 58
I have the xml stored in Writer object using VELOCITY. How can I convert this to an InputStream or InputSource to pass it to Document builder parse method for schema validation. Is there a better way?

Thanks
Adam Teg
Ranch Hand

Joined: Jul 10, 2007
Posts: 58
I can not write the file out to disk because of risk.
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14164
    
  19

What do you mean by "XML stored in a Writer object"? A Writer in Java, if you're talking about writers in the standard Java I/O API, is not something that you can store data into. It is a class that helps you write data to some storage such as a file.

Can you make your question more clear by providing a piece of code?


Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 7 API documentation
Scala Notes - My blog about Scala
Adam Teg
Ranch Hand

Joined: Jul 10, 2007
Posts: 58
I figured it out thanks. I meant a Writer java object.
 
 
subject: Writer to InputStream or source