Re: Well formedness Validation not proper in EXPAT

[email protected]
Newsgroups gmane.text.xml.expat.general
Message-ID <[email protected]>
On 15 Feb, [email protected] 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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.