Re: A special schema

Hi,

Ravin Shah wrote:

> Hi guys...
> 
> I need to write a schema file that will validate any xml file.  At
> least, this is what I think i need.


This is an interresting riddle and I don't think you can, at least not 
if you don't have a list of element names which can be used as document 
elements.

The wildcards for elements (xs:any) can only be used with a compositor 
(xs:sequence or xs:choice) which itself must be used directly or 
indirectly, within an element definition.

This means that you can only use them in an element which you know and 
this doesn't seem to be the case here.


> 
> I am writing a program that uses a parser to build DOM documents.  In
> particular, I am using SAXBuilder to build the documents from XML
> files.  For some of these documents, I have schema files to validate
> them against.  These schemas are mapped in the Entity Resolver.
> 
> For the documents that don't need to validated, I just want the parser
> to validate it against a dummy schema file that accepts anything.  Right
> now, it tries to validate it and for generates an error for each tag in
> the XML file.
> 
> If I knew whether or not the XML file needed to be validated before
> hand, I would just set up the SAXBuilder accordingly.  I do not know
> this before hand because xml documents that need to be validated will
> hold that information in the first tag and I can't see that before
> parsing.
> 
> Any help would be appreiated.


Your problem seems to be a use case for the proposal of "schema 
resolver" which I have done recently:

http://lists.w3.org/Archives/Public/xmlschema-dev/2001Nov/0069.html

The schema processor would call the schema resolver after having read 

the document element to ask or suggest a schema location for its

namespace and the schema resolver could answer with an new location,
accept the proposed one or ask the schema processor to skip the
validation of this namespace.

Unfortunately, it's just an idea and there is no implementation (yet?) 
behind!

Eric


> Thanks in advance
> 
> 
> 
> 
> 
> 
> 
> 



-- 
Rendez-vous à Paris pour le Forum XML.
                    http://www.technoforum.fr/Pages/forumXML01/index.html
------------------------------------------------------------------------
Eric van der Vlist       http://xmlfr.org            http://dyomedea.com
http://xsltunit.org      http://4xt.org           http://examplotron.org
------------------------------------------------------------------------

Received on Friday, 9 November 2001 04:36:18 UTC