File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes XML and Related Technologies and the fly likes about document2string 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 "about document2string" Watch "about document2string" New topic

about document2string

qingwu wang
Ranch Hand

Joined: Feb 19, 2003
Posts: 147
Hello Everyooooone:
pls help me!
the code snippet as following:

then I should udpMsg string like this:
but the result like this:
I compress it to pos.war,it can run and parse right in my pc,but I put it to another pc,it will cannt be parsed right.
I will very appreciate if anyone can help me!~

Thanks...qingwu<br />When I open my eyes,I see your pretty face.
Lasse Koskela

Joined: Jan 23, 2002
Posts: 11962
Why do I get the feeling that toString() is not promised to do anything particular and the other machine's/parser's DOM implementation classes just happen to output the XML representation...
I really think you should produce the XML using classes/methods documented in the API. Try something like this:

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

Joined: Feb 19, 2003
Posts: 147
but it default encoding is 'utf-8',I want to set it as 'GBK'.I use dom lever 2,it looks like not existing setEncoding method to Document object.
what should I do?
I agree. Here's the link:
subject: about document2string
It's not a secret anymore!