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



On Wed, 2005-06-08 at 10:24 +0200, Kasimier Buchcik wrote:
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.

After looking at the schema, it seems that the problem is not the
<any> wildcard: you need to validate with XSI-driven schema assembling.
The schema uses xsi:schemaLocation to load schemata dynamically when
needed. This is currently not accessibly via xmllint [2].
But you'll find an example at [1] about how do it otherwise -
Daniel did not add it to the code examples yet ;-)
If you need to use xmllint, you can create one additional schema,
<import> all other schemata and validate against this new schema.

In you lucky case the "##other" bug does not do any harm.

http://mail.gnome.org/archives/xml/2005-March/msg00048.html

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

Would be happy about a feedback here.

Regards,

Kasimier



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