jQuery in Action, 2nd edition
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
Register / Login


JavaRanch » Java Forums » Engineering » XML and Related Technologies
Reply 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://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: special characs lead to error in XML(jdom) :(
 
Similar Threads
Keytool
writing and reading simple data in XML
about XML security
JDOM alternative JAR file required
Beginning Java Web Services Code Problem