[
Lists Home |
Date Index |
Thread Index
]
- To: <peej@mindspring.com>,<xml-dev@lists.xml.org>
- Subject: RE: [xml-dev] (more details) embedding xml schema in an instance doc
- From: "Dare Obasanjo" <dareo@microsoft.com>
- Date: Mon, 10 Jun 2002 11:45:13 -0700
- Thread-index: AcIQrbyl2vFlDqBnRHeWpS1zBZFTKwAAFUMQ
- Thread-topic: [xml-dev] (more details) embedding xml schema in an instance doc
The schema For Schema contains a number of issues. Any parser that
validates it is broken.
I talked to one of our W3C XML Schema WG reps about how people should be
able to validate items from the http://www.w3.org/2001/XMLSchema
namespace and from what I got it seems that the best bet is for parser
implementations to allow importations of that namespace in target
schemas but not actually use the sForS for validation since by
definition being schema validators they already know about the
namespace.
Ideally should allow
<xs:import namespace="http://www.w3.org/2001/XMLSchema" />
in a target schema without needing a schemaLocation.
--
PITHY WORDS OF WISDOM
The shortest distance between two points is under repair.
This posting is provided "AS IS" with no warranties, and confers no
rights.
> -----Original Message-----
> From: peej@mindspring.com [mailto:peej@mindspring.com]
> Sent: Monday, June 10, 2002 11:36 AM
> To: xml-dev@lists.xml.org
> Subject: [xml-dev] (more details) embedding xml schema in an
> instance doc
>
>
> I posted a few days ago but with little detail...I thought
> providing more details would help.
>
> What I'm attempting to do is embed a "fragment" of XML Schema
> within an XML instance document. Refer to:
>
> http://digir.sourceforge.net/prot/beta3/requestExample.xml
>
> You'll notice, toward the bottom of the document, the element
> <structure> which contains some XML Schema (elements from the
> Schema grammar). XMLSpy
> has no problem with this instance document, and neither does
> whatever parser/validator exists within the browser.
> However, when I use this document within my java application,
> Xerces errors. If I use the document with the header as you
> see here, I get the following:
>
> Parsing Error on Line: 21 (General Schema Error: Grammar with
> uri: http://www.w3.org/2001/XMLSchema , can not be found;
> schema namespace may be wrong: Xerces supports schemas from
> the "http://www.w3.org/2001/XMLSchema"
> namespace or the instance document's namespace may not match
> the targetNamespace of the schema.)
> (org.xml.sax.SAXParseException: General Schema Error: Grammar
> with uri: http://www.w3.org/2001/XMLSchema , can not be
> found; schema namespace may be wrong: Xerces supports
> schemas from the "http://www.w3.org/2001/XMLSchema"
> namespace or the instance document's namespace may not match
> the targetNamespace of the schema.)
>
>
> This seems to say to me it can't find the grammar for
> XMLSchema and/or the parser isn't sure if its dealing with an
> instance document or a schema
> document. So if I modify the document to supply the
> schemaLocation for the xsd as so:
>
> <request xmlns="http://www.namespaceTBD.org/digir"
> xmlns:darwin="http://www.namespaceTBD.org/darwin2"xmlns:xsd="h
> ttp://www.w3.org/2001/XMLSchema"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>
> xsi:schemaLocation="http://www.namespaceTBD.org/digir
> http://digir.sourceforge.net/prot/beta3/digir.> xsd
> http://www.namespaceTBD.org/darwin2
>
http://digir.sourceforge.net/fed/beta3/darwin2.xsd
http://www.w3.org/2001/XMLSchema http://www.w3.org/2001/XMLSchema.xsd">
I get the following error:
Parsing Error on Line: 5 (Unknown base type for type
reducedDerivationControl. (org.xml.sax.SAXParseException: Unknown base
type for type reducedDerivationControl.)
The latter error here seems to come from Xerces being unable to validate
the actual schema for XMLSchema. Looking over that schema,
reducedDerivationControl extends from derivationControl and both types
are defined within the schema.
So what I'm wondering, outside of whether I should be able to do this or
not, is whether the schema for XMLSchema should be able to be
validated...or am I possibly uncovering a flaw with Xerces? Is there
something basic I'm
overlooking in my namespace specifications in my documents? It seems to
me that the XMLSchema namespace *should* be able to be viewed as any
other namespace from an instance document perspective. Does this seem
like blatently wrong thinking on my part?
Any advice would be greatly appreciated!
Thanks in advance,
P.J.
-----------------------------------------------------------------
The xml-dev list is sponsored by XML.org <http://www.xml.org>, an
initiative of OASIS <http://www.oasis-open.org>
The list archives are at http://lists.xml.org/archives/xml-dev/
To subscribe or unsubscribe from this list use the subscription
manager: <http://lists.xml.org/ob/adm.pl>
|