[jdom-interest] Attribute/CDATA question

Kirschen, David dkirschen at mil.emc.com
Wed May 23 12:14:49 PDT 2001


Hi,

I looked through the FAQ and the last couple of months of posting but did
not find the answer to this question.
This question arose using JDOM Beta 5 with the included xerces parser.

A parsing exception is thrown attempting to parse this construct:

anAttribute="<![CDATA[lots-of-text]]" >

The exception is: The value of attribute "anAttribute" must not contain the
'<' character.

Is this:
	- A known limitation of JDOM?
	- A JDOM bug?
	- Invalid XML?

The assumption is that it is valid XML, since the XML spec
(http://www.w3.org/TR/2000/REC-xml-20001006) says:

2.7 CDATA Sections
[Definition: CDATA sections may occur anywhere character data may occur;
they are used to escape blocks of text containing characters which would
otherwise be recognized as markup. CDATA sections begin with the string
"<![CDATA[" and end with the string "]]>":]

Any insights?

-Dave Kirschen





More information about the jdom-interest mailing list