logo       
Google Custom Search
    AddThis Social Bookmark Button

Re: How To Specify an xsd schema in a different directory with <xsd:import>: msg#00043

Subject: Re: How To Specify an xsd schema in a different directory with <xsd:import> schemaLocation attribute - Get "could not find the document" on XML parse
nbeyer@xxxxxxxxx wrote on 05/23/2007 11:26:19 PM:

> I believe the default behavior for loading relative paths is to
> resolve them against the "working directory" of the JRE, which would
> be similar to passing a relative path to a File constructor.

This is the fallback behaviour when no base URI is provided. Usually a 
sign a system ID wasn't set on the InputSource passed to the parse() 
method or on one returned from an EntityResolver.

> To provide more deterministic resolution, you can use the
> EntityResolver interface [1] if you're using SAX parsing. If you're
> using a more recent JAXP version, such as what's available in Java 5,
> you can setup an LSResourceResolve [2] on a SchemaFactory [3].
> 
> I've never personally tried the later.
> 
> -Nathan
> 
> [1] 
http://java.sun.com/j2se/1.5.0/docs/api/org/xml/sax/EntityResolver.html
> [2] http://java.sun.com/j2se/1.5.
> 0/docs/api/org/w3c/dom/ls/LSResourceResolver.html
> [3] http://java.sun.com/j2se/1.5.
> 0/docs/api/javax/xml/validation/SchemaFactory.html

Michael Glavassevich
XML Parser Development
IBM Toronto Lab
E-mail: mrglavas@xxxxxxxxxx
E-mail: mrglavas@xxxxxxxxxx



Try Searching:
servers, voip, java, networking, microsoft ...
<Prev in Thread] Current Thread [Next in Thread>