problem with XML W3C Conformance Test Suite 20080205

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

problem with XML W3C Conformance Test Suite 20080205

Daniel Veillard

  Hi all,

  While working on my 5th edition implementation testing I hit a problem
with the latest version of the test suite:

test rmt-ns10-035 : xmlconf/eduni/namespaces/1.0//035.xml failed to parse the XML
xmlconf/eduni/namespaces/1.0//035.xml:6: parser error : Attribute a:attr redefined
<bar a:attr="1" a:attr="2"/>
                          ^

the test is described as
<TEST RECOMMENDATION="NS1.0" SECTIONS="5.3" URI="035.xml" ID="rmt-ns10-035" TYPE="not-wf">
Attribute uniqueness: repeated identical attribute
</TEST>

and defined as

<?xml version="1.0"?>
<!-- Attribute uniqueness: repeated identical attribute -->
<foo xmlns:a="http://example.org/~wilbur"
     xmlns:b="http://example.org/~wilbur">

<bar a:attr="1" a:attr="2"/>

</foo>

 Seems to me there is a typo here. This is an XML-1.0 base well-formedness
error because it has the same attribute used twice on the element. I guess
the intent was to have
  <bar a:attr="1" b:attr="2"/>
(or the way around) which then is a namespace redeclaration issue.

Not seeing anything on the archives since Sept last year I assume this
wasn't raised yet and best discussed in the Core WG list :-)

  http://lists.w3.org/Archives/Public/public-xml-testsuite/

Daniel

--
Red Hat Virtualization group http://redhat.com/virtualization/
Daniel Veillard      | virtualization library  http://libvirt.org/
[hidden email]  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine  http://rpmfind.net/

Reply | Threaded
Open this post in threaded view
|

Re: problem with XML W3C Conformance Test Suite 20080205

Richard Tobin-2

> <bar a:attr="1" a:attr="2"/>

>  Seems to me there is a typo here. This is an XML-1.0 base well-formedness
> error because it has the same attribute used twice on the element.

Yes, but it's also a namespaces error, because

  http://www.w3.org/TR/REC-xml-names/#uniqAttrs

says:

  In XML documents conforming to this specification, no tag may
  contain two attributes which:
  1. have identical names, or
  2. have qualified names with the same local part and with prefixes which
     have been bound to namespace names that are identical.

So this test in principle duplicates one of the plain XML tests, but
that doesn't matter (and it may in fact be different in that the
attribute has a prefix).

> I guess the intent was to have
>   <bar a:attr="1" b:attr="2"/>

That's test 036 :-)

-- Richard

--
The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.


Reply | Threaded
Open this post in threaded view
|

Re: problem with XML W3C Conformance Test Suite 20080205

Daniel Veillard

On Wed, Aug 06, 2008 at 03:16:48PM +0100, Richard Tobin wrote:

>
> > <bar a:attr="1" a:attr="2"/>
>
> >  Seems to me there is a typo here. This is an XML-1.0 base well-formedness
> > error because it has the same attribute used twice on the element.
>
> Yes, but it's also a namespaces error, because
>
>   http://www.w3.org/TR/REC-xml-names/#uniqAttrs
>
> says:
>
>   In XML documents conforming to this specification, no tag may
>   contain two attributes which:
>   1. have identical names, or
>   2. have qualified names with the same local part and with prefixes which
>      have been bound to namespace names that are identical.
>
> So this test in principle duplicates one of the plain XML tests, but
> that doesn't matter (and it may in fact be different in that the
> attribute has a prefix).

  To me a plain well-formedness error clearly take precedence over a
namespace error since document which doesn't conform to REC-xml-names can
still be usable data, while a not well-formed one must break.
  I still think the error is miscategorized, and will supress it from
my regression runs. And I really don't think XML parsers should report
a namespace error there but the XML-1.0 wellformedness error which is
far more critical and general.

Daniel

--
Red Hat Virtualization group http://redhat.com/virtualization/
Daniel Veillard      | virtualization library  http://libvirt.org/
[hidden email]  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine  http://rpmfind.net/

Reply | Threaded
Open this post in threaded view
|

Re: problem with XML W3C Conformance Test Suite 20080205

Richard Tobin-2
In reply to this post by Daniel Veillard

>   To me a plain well-formedness error clearly take precedence over a
> namespace error since document which doesn't conform to REC-xml-names can
> still be usable data, while a not well-formed one must break.
>   I still think the error is miscategorized, and will supress it from
> my regression runs. And I really don't think XML parsers should report
> a namespace error there but the XML-1.0 wellformedness error which is
> far more critical and general.

The test suite doesn't require any particular error message.  To
pass the test all you have to do is reject the document.  The fact
that you reject it because of the XML well-formedness error is
unimportant.

-- Richard

--
The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.


Reply | Threaded
Open this post in threaded view
|

Re: problem with XML W3C Conformance Test Suite 20080205

Daniel Veillard

On Thu, Aug 07, 2008 at 05:36:57PM +0100, Richard Tobin wrote:

> >   To me a plain well-formedness error clearly take precedence over a
> > namespace error since document which doesn't conform to REC-xml-names can
> > still be usable data, while a not well-formed one must break.
> >   I still think the error is miscategorized, and will supress it from
> > my regression runs. And I really don't think XML parsers should report
> > a namespace error there but the XML-1.0 wellformedness error which is
> > far more critical and general.
>
> The test suite doesn't require any particular error message.  To
> pass the test all you have to do is reject the document.  The fact
> that you reject it because of the XML well-formedness error is
> unimportant.

  I disgree again.

  <a:/>
  (or the example used in the test)

is a well formed document. It has no way to indicate it expect (or not) to
use namespace, a XML-1.0 parser must accept it. Now a NS-1.0 compliant parser
must report the violation, but nowhere from section 7 or 8 is the parser
instructed to *reject* the document.
Hence it's my opinion important that XML parser do not reject document
not namespace-well-formed , but as indicated they must report the error
if they want to be NS-1.0 compliant.

Assuming rejection for NS-1.0 compliance sounds wrong to me. This case
of the test suite seems to assume this.

Daniel

--
Red Hat Virtualization group http://redhat.com/virtualization/
Daniel Veillard      | virtualization library  http://libvirt.org/
[hidden email]  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine  http://rpmfind.net/