Hi,

I looked at the documentation from Sun.
I tried the "http://java.sun.com/xml/jaxp/properties/schemaSource" property and it works fine. I can register schema locations by reading the schema files.

sample code :

saxFactory = SAXParserFactory.newInstance();
saxFactory.setNamespaceAware(true);
FileFilter xsdFileFilter = new FileFilter() {
        public boolean accept(File pPathName) {
                if (pPathName.getName().endsWith(".xsd")) {
                        return true;
                }
                return false;
        }
};
File[] xsdFiles = xsdDir.listFiles(xsdFileFilter);
saxFactory.setProperty("http://java.sun.com/xml/jaxp/properties/schemaSource", xsdFiles);

The problem is that I must do this job each time I need a SAXParser. Is there any means to use the "http://java.sun.com/xml/jaxp/properties/schemaSource" property at the SAXParserFactory level ?
I cannot use always the same SAXParser because I am in a multi-thread environment and the SAXParser is not required to be thread safe.

Thanks for any help

Francois Banel
tel : 01 53 34 30 64
mailto:[EMAIL PROTECTED]



[EMAIL PROTECTED]

23/06/2003 10:24
Please respond to xerces-j-user

       
        To:        [EMAIL PROTECTED]
        cc:        
        Subject:        RE: registering schema locations




Thank you, this seems to be a good and simple solution to my problem.

I will try this.

Francois Banel
tel : 01 53 34 30 64
mailto:[EMAIL PROTECTED]


"O'Keeffe, Michael" <[EMAIL PROTECTED]>

19/06/2003 18:15
Please respond to xerces-j-user

       
       To:        "'[EMAIL PROTECTED]'" <[EMAIL PROTECTED]>

       cc:        

       Subject:        RE: registering schema locations




Here is some good documentation from Sun illustrating how to configure it with JAXP (with Xerces as the parser).

 
http://java.sun.com/webservices/docs/1.0/tutorial/doc/JAXPDOM9.html#63997
-----Original Message-----
From:
[EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent:
Thursday, June 19, 2003 10:32 AM
To:
[EMAIL PROTECTED]
Subject:
Re: registering schema locations



Thank you for the response.


The XML documents I use are generated by JAXB (Sun Java XML Binding Framework), and JAXB is aware of namespaces, but not aware of schema locations.

So the XML documents generated do not contain any schema location information.


If there is no standard way to register schema locations, does Xerces provide this facility in a proprietary way ?



Francois Banel
tel : 01 53 34 30 64
mailto:[EMAIL PROTECTED]

Joseph Kesselman <[EMAIL PROTECTED]>

19/06/2003 14:52
Please respond to xerces-j-user

       
      To:        [EMAIL PROTECTED]

      cc:        

      Subject:        Re: registering schema locations









The W3C's Semantic Web folks are investigating what metadata, if any, is
implied by a namespace and how it should be retrieved and used.  Until they
report out, the official answer is that a namespace URI is only a magic
string in URI syntax. It does not imply a specific schema, and indeed may
be referenced by many schema documents. So for now, even if you can make
this work, it's going to be a unique solution for your own application and
won't work for anyone else.

What's wrong with having the document explicitly declare which schemas it
needs? It has to declare the namespaces, and if anyone knows the mapping
from one to the other it should be no harder to build that into the
document than to try to imply it afterward... and if it's in the document
you avoid having to blaze a path into uncharted and (at least for now)
nonportable terratory.

______________________________________
Joe Kesselman, IBM Next-Generation Web Technologies: XML, XSL and more.
"The world changed profoundly and unpredictably the day Tim Berners Lee
got bitten by a radioactive spider." -- Rafe Culpin, in r.m.filk


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





Reply via email to