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 special characs lead to error in XML(jdom) :( Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "special characs lead to error in XML(jdom) :(" Watch "special characs lead to error in XML(jdom) :(" New topic
Author

special characs lead to error in XML(jdom) :(

Robert Jaeger
Ranch Hand

Joined: Apr 29, 2002
Posts: 62
Hi,
I am manipulating passwords with the java.security Package before saving them in XML. Unfortunately JDOM reports an error while I try to set the password in XML. The reason are the password´┐Żs special characters created by the java.security Package.

How can I force JDOM to store the password?
It would be great if someone has an idea

Robert.
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
You could apply Base64 encoding on the password before stuffing it into the XML document (and of course decode it when reading).


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

Joined: Apr 29, 2002
Posts: 62
Well, finally I made it with a "byte to hex"-transformation.
However, thanky for your suggestion!
Robert
 
 
subject: special characs lead to error in XML(jdom) :(