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

devyani.sapre at wipro.com devyani.sapre at wipro.com
Wed Feb 15 12:02:06 CET 2006


Hi

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.

Thanks
Devyani



-----Original Message-----
From: rolf at pointsman.de [mailto:rolf at pointsman.de]
Sent: Wednesday, February 15, 2006 3:16 PM
To: DEVYANI SAPRE (WT01 - Broadband Networks)
Cc: expat-discuss at libexpat.org
Subject: Re: [Expat-discuss] Well formedness Validation not proper in
EXPAT


On 15 Feb, devyani.sapre at wipro.com wrote:
>  I am using expat parser to validate my XML file. But I have noticed
> that it does not check well formed ness completely

Expat does no DTD validation, but - as any other XML rec compliant
parser - does all well-formedness checks.

> I have an xml tag in my XML file as
>
>             <name>Devyani<name>>>>>>

Unfortunately, this isn't a complete example, but obviously only a
part of an XML file. You open two 'name' elements and you've a little
bit PCDATA. There isn't nothing bad about that other that it isn't a
complete XML file. If I try something like

  <doc><name>Devyani<name>>>>>></name></name></doc>

or

  <doc><name>Devyani</name>>>>>></doc>

then both documents are accepted by expat - and that is correct. There
is nothing special about > within PCDATA element content.

> While parsing the file with such an entry the Expat parser does not
> throw any error. Is there a way such check can be done within expat?

Please provide a small, but complete example file.

> Xerces parsers do this validation and throw an error for this but
Expat
> does not do so. :-(

If you've an XML file, and Xerces claims a well-formedness error and
expat does not, then one of the two parsers is wrong. Well-formedness
errors must be reported. Either there is really one, then expat should
report it, or there isn't one, then Xerces shouldn not report
one. Again, please provide a small, but complete example, which shows
the problem.

rolf




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