[jdom-interest] url as attribute value changes & to &

Phillip Rhodes spamsucks at rhoderunner.com
Sat Jul 27 07:58:37 PDT 2002

I understand your point, that it is invalid to have an unescaped ampersand 
as an attribute value in xml.

But I'm stuck now.  Looking for some ideas.  I am using jdom to build a 
html page.  So currently, there is no process that will unescape the 

Are you saying write string search and replace program?  This feels kind of 
Just hoping to get some ideas.  I am going to investigate doing it in an 
xsl stylesheet after output from jdom.

At 08:30 AM 7/26/2002 -0400, Elliotte Rusty Harold wrote:
>At 11:41 PM -0400 7/25/02, Phillip Rhodes wrote:
>>I saw a reference to this in the FAQ, and a couple prior postings, but I 
>>still do not see the solution.
>>My problem is simple.  I am creating a "img" element , and set an 
>>attribute called "src" to be the URL that will build a dynamic graph.
>>I use XMLOutputter to create my <img src="url is here"/>
>JDOM is correct. You cannot include an unescaped ampersand in an attribute 
>value in XML. Whichever process is failing to unescape the &amp; in the 
>attribute values before using it as a URL is incorrect. You will have to 
>fix the process on the other end.
>| Elliotte Rusty Harold | elharo at metalab.unc.edu | Writer/Programmer |
>|          XML in a  Nutshell, 2nd Edition (O'Reilly, 2002)          |
>|              http://www.cafeconleche.org/books/xian2/              |
>|  http://www.amazon.com/exec/obidos/ISBN%3D0596002920/cafeaulaitA/  |
>|  Read Cafe au Lait for Java News:  http://www.cafeaulait.org/      |
>|  Read Cafe con Leche for XML News: http://www.cafeconleche.org/    |

More information about the jdom-interest mailing list