[Expat-discuss] Well formedness Validation not proper in EXPAT

devyani.sapre at wipro.com devyani.sapre at wipro.com
Fri Feb 17 05:40:05 CET 2006


Hi rolf,

Thanks a lot for clarification , I verified it with both xerces and
expat and they are treating such an entry as wellformed only. But if I
have  a ">"  at the end of the last tag of the file (as given below) ,
both throw an error. Can you please explain me this behaviour too???

Eg:

<doc>
 	<name1>devyani</name1>>>>> 
	<name2>raj</name2>
</doc>>>


Thanks
Devyani





-----Original Message-----
From: Reid Spencer [mailto:reid at x10sys.com]
Sent: Friday, February 17, 2006 3:21 AM
To: rolf at pointsman.de
Cc: DEVYANI SAPRE (WT01 - Broadband Networks); Expat List
Subject: Re: [Expat-discuss] Well formedness Validation not proper in
EXPAT

I would concur with rolf's interpretation. Note that section 2.4 of the
XML specification states:

The ampersand character (&) and the left angle bracket (<) MUST NOT
appear in their literal form, except when used as markup delimiters, or
within a comment, a processing instruction, or a CDATA section. If they
are needed elsewhere, they MUST be escaped using either numeric
character references or the strings "&amp;" and "&lt;" respectively. The
right angle bracket (>) MAY be represented using the string "&gt;", and
MUST, for compatibility, be escaped using either "&gt;" or a character
reference when it appears in the string "]]>" in content, when that
string is not marking the end of a CDATA section.

So, the < character in the character data would constitute a violation
of well-formedness. But, the same does not hold true for >. So, the
document is well formed and xerces is complaining about something it
should not complain about.

Reid.

On Wed, 2006-02-15 at 12:24 +0100, rolf at pointsman.de wrote:
> On 15 Feb, devyani.sapre at wipro.com wrote:
> > There was a typo in the example. It looks something like this
> >
> > <doc>>>>
> > 	<name1>devyani</name1>>>>
> > 	<name2>raj</name2>
> > </doc>
> >
> > My question is how can I catch such a problem since in my knowledge
> > EXPAT does not treat it as a WELL formed ness error but XERCES does.
>
> What I see is perfect well-formed XML.
>
> Which well-formedness error do you see, in your example?  What error
> msg does Xerces gives you?
>
> If Xerces in fact doesn't parse your example XML, then that is a
> Xerces bug.
>
> rolf
>
>
> _______________________________________________
> Expat-discuss mailing list
> Expat-discuss at libexpat.org
> http://mail.libexpat.org/mailman/listinfo/expat-discuss


The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments.

WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email.

www.wipro.com


More information about the Expat-discuss mailing list