digiarnie digiarnie - 1 year ago 150
Java Question

dom4j converting text to special characters

I'm using dom4j to parse my xml. Let's say I have something like this:

<?xml version="1.0" encoding="UTF-8"?>

When looking at the value of the "bar" node, it gives me back the special character as represented by "& #402;"

Is there a way to prevent this and just read in the actual bit of text?

Answer Source

The actual bit of text being &#402;? You need to escape ampersand as &amp; then.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download