my dog learned polymorphism*
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
Author

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
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
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?
 
Don't get me started about those stupid light bulbs.
 
subject: about document2string