[jdom-interest] attribute values with "&"

Malachi de AElfweald malachi at tremerechantry.com
Wed Dec 4 22:51:36 PST 2002

Or have them put the data inside a CDATA tag.
You said you have no control over the input file, but you might point out 
that their file is invalid XML.


On Wed, 4 Dec 2002 14:43:28 -0500 (EST), bob mcwhirter <bob at werken.com> wrote:

>> <b y="/a?b=c&d=f">a</b>
>> org.jdom.JDOMException: Error on line 1: The reference to entity
>> "d" must end with the ';' delimiter.
>> I have no control over the input file.  It is being supplied by a
>> partner.  I have to parse this file and return a new version with a
>> similar attribute value.  Is this a valid XML attribute value?  If so,
>> what can I do to parse this file?
> Nope.  It's bogus.
> The & character introduces an entity which ends with a semi-colon, such 
> as &amp; or &apos;.
> The single ampersand should be replaced by &amp; to be valid:
> 	<b y="/a?b=c&ampd=f">
> Ugly indeed.  But conformant.
> 	-bob
> _______________________________________________
> To control your jdom-interest membership:
> http://lists.denveronline.net/mailman/options/jdom- 
> interest/youraddr at yourhost.com


More information about the jdom-interest mailing list