Two Laptop Bag*
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 Java 8 in Action this week in the Java 8 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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: special characs lead to error in XML(jdom) :(
 
Similar Threads
Beginning Java Web Services Code Problem
writing and reading simple data in XML
Keytool
about XML security
JDOM alternative JAR file required