You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-users@xerces.apache.org by "Soosai, Lourdhu Vasanth" <Lo...@aetna.com> on 2003/03/17 22:01:50 UTC
RE: bug
hi ,
iam try to validate a xml file
<?xml version="1.0"?>
<config>
<parameter name="Encryption_Redirect_Url">
<value><![CDATA[some cdata contrent]]</value>
</parameter>
<parameter name="Encryption_Redirect_Url">
<value><![CDATA[some cdata content]]></value>
</parameter>
</config>
even when the document is missing a ending tag for the first cdata
the parser say the document
is valid .
iam using xerces that comes with ibm wasd 4.0.3...is this a bug with
the parser?
thx
vasanth
This e-mail may contain confidential or privileged information. If you
think you have received this e-mail in error, please advise the sender by
reply e-mail and then delete this e-mail immediately. Thank you. Aetna
---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-user-help@xml.apache.org
Re: bug
Posted by Andy Clark <an...@apache.org>.
Soosai, Lourdhu Vasanth wrote:
> <value><![CDATA[some cdata contrent]]</value>
> [...]
> <value><![CDATA[some cdata content]]></value>
> </parameter>
> </config>
>
> even when the document is missing a ending tag for the first cdata
> the parser say the document
> is valid .
> iam using xerces that comes with ibm wasd 4.0.3...is this a bug with
> the parser?
This is not a bug. The XML specification states that the
content of a CDATA section cannot contain the string "]]>".
This does not, however, disallow just "]]". So everything
from the first start CDATA section (i.e. "<![CDATA[") until
the end of the *second* CDATA section is considered part
of the *first* <value> element's content.
This works in your sample because the following end element
matches the start element where the first CDATA section was
opened. The following, however, would signal an error because
the end element </bar> doesn't match the start element <foo>.
<root>
<foo><![CDATA[ oops! this is not closed ]]</foo>
<bar><![CDATA[ this will cause an error ]]></bar>
</root>
--
Andy Clark * andyc@apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-user-help@xml.apache.org