Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Agile forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

about document2string

 
qingwu wang
Ranch Hand
Posts: 147
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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!~
 
Lasse Koskela
author
Sheriff
Posts: 11962
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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:
 
qingwu wang
Ranch Hand
Posts: 147
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic