File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes XML and Related Technologies and the fly likes XML doument to a string Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "XML doument to a string" Watch "XML doument to a string" New topic
Author

XML doument to a string

Manish Hatwalne
Ranch Hand

Joined: Sep 22, 2001
Posts: 2578

I have written this function to covert XML document to a string, but it does not work with JWS (works well in a standalone application as well as servlet) hence I was wondering if there's another approach to convert XML document to a String -

TIA,
- Manish
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
What do you mean by "does not work"? Does it throw an exception or is the output different from what you expected?


Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
Manish Hatwalne
Ranch Hand

Joined: Sep 22, 2001
Posts: 2578

It throws this exception -
Can not convert XML document to String
org.apache.xml.utils.WrappedRuntimeException: Output method is xml could not
load output_xml.properties (check CLASSPATH)
I suspect this is due to the fact that a JWS application cannot read properties. However, I do not know what could be a possible workaround.
TIA,
- Manish
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
Check this out.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: XML doument to a string
 
Similar Threads
Getting length(no of bytes) of Dom document which is in memory
have node object, need to view it's xml?
Problems converting a node to string
Transformer - omitting the xml header (" ?xml encoding=.. ?" )
getting Document fragment as String