xerces-j-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Glavassevich <mrgla...@ca.ibm.com>
Subject Re: HTTP OUTGOING CACHING
Date Mon, 17 Sep 2007 21:22:55 GMT
Specifically you need to register [1] an LSResourceResolver [2].

XSLoader schemaLoader = impl.createXSLoader(null);
DOMConfiguration config = schemaLoader.getConfig();
...
LSResourceResolver resolver = ...;
config.setParameter("resource-resolver", resolver);
...

[1]
http://www.w3.org/Submission/2004/SUBM-xmlschema-api-20040309/xml-schema-api.html#Interface-Loader
[2]
http://xerces.apache.org/xerces2-j/javadocs/api/org/w3c/dom/ls/LSResourceResolver.html


Michael Glavassevich
XML Parser Development
IBM Toronto Lab
E-mail: mrglavas@ca.ibm.com
E-mail: mrglavas@apache.org

Francesco Lazzarino <flaz@ufl.edu> wrote on 09/17/2007 05:04:23 PM:

> you can use an alternate EntityResolver.
>
> for an example check out:
> http://daitss.fcla.edu/browser/xmlvalidator/trunk
>
> it can be checked out via:
>
> svn co http://daitss.fcla.edu/repos/xmlvalidator/trunk/
>
> its a validator that can use a filesystem based cache with temporal
> expiration. its straightforwardd code. no external jars.
>
> and if you want to use the code, its GPL.
>
> -franco
>
> On Mon, Sep 17, 2007 at 04:26:28PM -0400, Jing Yang wrote:
> > www.w3.org  block my accessing  due to re-questing files too often.
> >
> > I found  one   importing schema was  <xsd:import
> > namespace="http://www.w3.org/XML/1998/namespace"
> > schemaLocation="http://www.w3.org/2001/xml.xsd"/>
> >
> >
> >
> > Does XSLoader provide the mechanism to avoid  repeated loading  schema
> > during high capacity volume process ?
> >
> > How to work with this issue ? The Xerces  is 2_9_0. The code is as
below:
> >
> >
> >
> >
System.setProperty(DOMImplementationRegistry.PROPERTY,"org.apache.xerces.dom

> > .DOMXSImplementationSourceImpl");
> >
> > DOMImplementationRegistry registry =
> > DOMImplementationRegistry.newInstance();
> >
> > XSImplementation impl = (XSImplementation)
> > registry.getDOMImplementation("XS-Loader");
> >
> > XSLoader schemaLoader = impl.createXSLoader(null);
> >
> > DOMConfiguration config = schemaLoader.getConfig();
> >
> > // set error handler
> >
> > config.setParameter("error-handler", this);
> >
> > // set validation feature
> >
> > config.setParameter("validate", Boolean.TRUE);
> >
> > //    parse document
> >
> > XSModel model = schemaLoader.loadURI(schemaURL);
> >
>
> --
> Francesco Lazzarino
> Digital Archive Programmer
> Florida Center for Library Automation
> http://daitss.fcla.edu
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: j-users-unsubscribe@xerces.apache.org
> For additional commands, e-mail: j-users-help@xerces.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: j-users-unsubscribe@xerces.apache.org
For additional commands, e-mail: j-users-help@xerces.apache.org


Mime
View raw message