Michael,

Thanks for the input, I hope someone else out there has some more insight.
The problem I am running into is that different parsers deal with this
differently.  Which on is right?

XML Spy Version 5 rel 2 validates the given example with no problems.
It seems as though XML Spy thinks that the XSD should be relative to the
resource (xml file) not the other schema:

<lom xmlns = "http://ltsc.ieee.org/xsd/LOM";
      xmlns:xsi = "http://www.w3.org/2001/XMLSchema-instance";
      xsi:schemaLocation = "http://ltsc.ieee.org/xsd/LOM lom.xsd
                            http://ltsc.ieee.org/xsd/LOM/custom
vocab/ext_vocab.xsd">

So again, two highly qualified XML parsers producing different results.
What is the right answer?

Thanks
Schawn
-----Original Message-----
From: Michael Glavassevich
To: '[EMAIL PROTECTED]'
Sent: 11/13/2003 10:46 AM
Subject: Re: Resolving Relative URI - Xerces J2.5.0

Hi Shawn,

This has come up on a few occasions [1]. In that last discussion I
argued
that relative URIs in the schemaLocation hints are relative to the
resource in which they're actually dereferenced. Now I'm not so sure.
You
could argue that they're relative to the document entity or some base
URI
you've specified using xml:base. There doesn't seem to be anything in
the
spec [2] on how a schema processor should resolve realtive URIs
specified
in the schemaLocation hints.

I'm sure someone else on the list could provide more insight.

[1] http://marc.theaimsgroup.com/?l=xerces-j-user&m=105614937202145&w=2
[2] http://www.w3.org/TR/xmlschema-1/#schema-loc

On Thu, 13 Nov 2003, Thropp, Shawn wrote:

> I am seeing something strange when trying to validate XML instance
with
> Xerces-J 2.5.0.
>
> I have the following structure defined:
>
> vocab/ext_vocab.xsd
> lom.xsd
> example.xml
>
> Inside of example.xml I have the following declaration:
>
> <lom xmlns = "http://ltsc.ieee.org/xsd/LOM";
>      xmlns:xsi = "http://www.w3.org/2001/XMLSchema-instance";
>      xsi:schemaLocation = "http://ltsc.ieee.org/xsd/LOM lom.xsd
>                            http://ltsc.ieee.org/xsd/LOM/custom
> ext_vocab.xsd">
>
> This version validates when I use the dom.Writer sample provided by
> Xerces-J.  However, I don't think it is correct.
> I would think that the declaration in my example.xml should be:
>
> <lom xmlns = "http://ltsc.ieee.org/xsd/LOM";
>      xmlns:xsi = "http://www.w3.org/2001/XMLSchema-instance";
>      xsi:schemaLocation = "http://ltsc.ieee.org/xsd/LOM lom.xsd
>                            http://ltsc.ieee.org/xsd/LOM/custom
> vocab/ext_vocab.xsd">
>
> Since the ext_vocab.xsd is located in a folder called vocab.  The
relative
> location from the root to the xsd is vocab/ext_vocab.xsd
>
> However is I change the schemaLocation to the way it is above I get
> validation errors:
>
> C:\workarea\XML Parsers\xerces250\xerces-2_5_0>java dom.Writer -v -n
-s
> test\lomwd2\UniqueStrict_VocabCustom\example1.xml
> [Error] custom.xsd:34:65: src-resolve: Cannot resolve the name
> 'lx:sourceValues' to a(n) 'type definition' component.
>
> and a few others.
>
> This indicates to me that the parser cannot locate the ext_vocab.xsd.
Is
> this a known bug or am I missing something.
>
> Thanks for all the help
> Schawn
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]

---------------------------
Michael Glavassevich
XML Parser Development
IBM Toronto Lab
E-mail: [EMAIL PROTECTED]
E-mail: [EMAIL PROTECTED]

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

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

Reply via email to