Re: [xml] XML Schema 'any' element support



On Tue, 2005-06-07 at 19:19 +0200, Martijn Faassen wrote:
Hi there,

I'm getting some validation errors with an XML schema containing the 
following:

       <any namespace="##other" processContents="strict"/>

The errors are along these lines:

test.xml:25: element rfc1807: Schemas validity error : Element 'rfc1807' 
[strict wildcard]: No matching global declaration available.
test.xml:40: element dc: Schemas validity error : Element 'oai_dc:dc' 
[strict wildcard]: No matching global declaration available.

Verifying this against another validator (Xerces C, Xerces Java), the 
example does validate against the schema. This was to be expected, as 
the example I used is from the OAI-PMH spec (ListRecords, first example) 
and I'm using the XML Schema for OAI-PMH, see, www.openarchives.org, in 
particular:

http://www.openarchives.org/OAI/openarchivesprotocol.html

http://www.openarchives.org/OAI/openarchivesprotocol.html#ListRecords

http://www.openarchives.org/OAI/2.0/OAI-PMH.xsd

libxml2 schemas seems to fail against it though.

Is this a known limitation? The closest error I found in bugzilla 
appears to be this one:

http://bugzilla.gnome.org/show_bug.cgi?id=172215

Yes, this is the known bug.


I tried various varieties for any, such as:

       <any namespace="##other" />

but this seemed to have no effect on the error.

It has no effect, since the default value for processContents
is "strict"; so it's the same as in your first example.

<any> with a namespace specifier of ##other does really not work
yet :-( It renders many schemata useless, since it lets through
_all_ elements, whatever namespace they are in; if maxOccurs is
e.g. 5, it will let through the next 5 elements and apply the
processContents constraints on them. I'll try to commit a new
version of xmlschemas.c today, which is able to workaround such
a case if minOccurs and maxOccurs are both 1.

Regards,

Kasimier



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]