Re: xsi:schemaLocation in XML files

2007-10-10 Thread Chris Bray
All. That's exactly what I decided to do, my URI's all point to canonical schema locations that will eventually be URL's that refer to file locations on the server, however currently they don't exist since the project has not been released for the public. Therefore my testers can use a catalog

Re: xsi:schemaLocation in XML files

2007-10-09 Thread Jacob Kjome
Normally, you would specify a canonical schema location. This might just be the name of the file or some official qualified name. Usually, a URL is used, which sometimes actually points to a location where the file can be downloaded. By hosting the file at a live URL, users can use this ca

Re: xsi:schemaLocation in XML files

2007-10-09 Thread Chris Bray
It looks like xjParse does what I need by specifying -S a.xsd -S b.xsd etc on the command line, so I do still have a "no code" solution :) The Xerces plugin for jEdit does also have the facility to import catalog files, would I be right in assuming I can write a catalog file, use that in jEd

Re: xsi:schemaLocation in XML files

2007-10-08 Thread Prashant Reddy
Apologize for the mis-information. Thank you Micheal for the correction. -Prashant On Mon, 2007-10-08 at 10:52 -0400, Michael Glavassevich wrote: > Relative URIs are resolved against the base URI of the document in which > they're contained. If no base URI has been specified (i.e. the application

Re: xsi:schemaLocation in XML files

2007-10-08 Thread Michael Glavassevich
Chris, If you're trying to avoid writing code to make this work you may want to consider using a more schema centric command-line program like xjparse [1] or jaxp.SourceValidator [2] instead of dom.Counter. With either of those you can specify a list of schema documents to use for validation. Addi

Re: xsi:schemaLocation in XML files

2007-10-08 Thread Jeff Greif
I think there's a better way which I'll sketch (because my project uses a version of Xerces that is from before the DOM Level 3 interfaces were included, so does something similar using older stuff). A standard XML parser may be associated with an EntityResolver, which supports a method taking a U

Re: xsi:schemaLocation in XML files

2007-10-08 Thread Chris Bray
Michael, I'm using Xerces-J 2.9.1, I even upgraded from 2.9.0 today to test any changes! Jeff, can you bear with me here I think I understand you... Jeff Greif wrote: Maybe an example will be clearer. The instance document is, relative to some subtree of the file system, in instances/article

Re: xsi:schemaLocation in XML files

2007-10-08 Thread Jeff Greif
Maybe an example will be clearer. The instance document is, relative to some subtree of the file system, in instances/articles/doc1.xml There is a set of schemas that apply in schemas/{a,b,c,d}.xsd Suppose a.xsd imports b.xsd, and in addition, doc1.xml refers to components from nsa, the namesp

Re: xsi:schemaLocation in XML files

2007-10-08 Thread Michael Glavassevich
Just a sanity check... What version of Xerces-J are you using? Michael Glavassevich XML Parser Development IBM Toronto Lab E-mail: [EMAIL PROTECTED] E-mail: [EMAIL PROTECTED] Chris Bray <[EMAIL PROTECTED]> wrote on 10/08/2007 12:25:43 PM: > Jeff. > > My comments inline. > > Chris > > Jeff Greif

Re: xsi:schemaLocation in XML files

2007-10-08 Thread Chris Bray
Jeff. My comments inline. Chris Jeff Greif wrote: When a relative URL is used for the location of an imported schema, it is supposed to be relative to the URL of the importing document. So if your instance document directly references the namespaces of one or more schemas for validation, whos

Re: xsi:schemaLocation in XML files

2007-10-08 Thread Michael Glavassevich
Relative URIs are resolved against the base URI of the document in which they're contained. If no base URI has been specified (i.e. the application didn't set the system ID on the InputSource [1]) the parser falls back to using the "current working directory" for resolving relative URIs. Thanks.

Re: xsi:schemaLocation in XML files

2007-10-08 Thread Jeff Greif
When a relative URL is used for the location of an imported schema, it is supposed to be relative to the URL of the importing document. So if your instance document directly references the namespaces of one or more schemas for validation, whose URLs are interpreted relative to the location of the

Re: xsi:schemaLocation in XML files

2007-10-08 Thread Chris Bray
Parshant, Changing the working dir of the JVM doesn't seem to make any difference, using dom.Counter from the Xerces-J samples the parser still seems to change the working dir first to wherever the xml file is located, then to wherever the first xsd file specified is located and need all subs

Re: xsi:schemaLocation in XML files

2007-10-08 Thread Prashant Reddy
I also dug up this document about jEdit, Xerces plugin : http://plugins.jedit.org/plugindoc/XML/other-plugins.html Unfortunately the part about EntityResolvers is vague to me. It is also possible to call the XML plugin's entity resolver method to resolve public and system IDs. This method is i

Re: xsi:schemaLocation in XML files

2007-10-08 Thread Prashant Reddy
I think the relative paths you have specified in the schemaLocation will be resolved against the "working dir". The working dir is usually the directory at the cmd prompt when you launched the JVM. Have you tried giving absolute path to the XSD files ? A more portable solution to finding schema