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

Elliotte Rusty Harold elharo at metalab.unc.edu
Fri Jul 26 05:30:13 PDT 2002

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