You are viewing a plain text version of this content. The canonical link for it is here.
Posted to general@xerces.apache.org by Ted Leung <tw...@sauria.com> on 2000/01/04 19:42:53 UTC

Re: Schemas and Namespaces

I see that Henry Thompson has answered your question over in xml-dev.
In general, questions like this are more appropriate for xml-dev, since some
of
the people from the Schema Working Group actually hang out there.

Questions about the Xerces implementation of schema are definitely
appropriate
here.

Ted
----- Original Message -----
From: "Brett McLaughlin" <bm...@algx.net>
To: <xe...@xml.apache.org>
Sent: Friday, December 31, 1999 3:11 PM
Subject: Re: Schemas and Namespaces


> Ted-
>
> First, thanks so much for the response.  You have saved my (and my
> editor's ;-) ) day.  I seehow they have somewhat changed in regards to
> this.  Let me see if I understand this correctly, and thanks for your
> response again:
>
> My XML doc:
>
> <?xml version="1.0"?>
>
> <New:Doc xmlns="mySchema.xsd">
>   <New:Element1>
>     <New:Element2 />
>   </New:Element1>
>   <Element3 />
> </New:Doc>
>
> and then my schema:
>
> <schema targetNamespace="http://myUrl.com"
>         xmlns="http://www.w3.org/1999/XMLSchema"
>         xmlns:New="http://myUrl.com">
>
>   <element name="New:Element1" type="New:myElementType" />
>
>   <type name="myElementType">
>     <element name="New:Element2 type="string" minOccurs="0" />
>   </type>
>
>   <element name="Element3" type="string" />
>
> </schema>
>
>
> I understand the use of the targetNamespace in the Schema, as
> myElementType is not part of the XML Schema defined namespace, but part
> of the target one.  That makes sense to me.  I also get the two
> namespace (xmlns) attributes of the schema element.  What I am not sure
> of is if my original XML document needs to define both namespaces, and
> how it would do that; as well as if it needs to prefix all elements with
> the "New" namespace.  Lots has changed, that's for sure (my first draft
> of the schema bit 3 weeks ago had archetype all over the place ;-) )
>
> Thanks for you help on this...
>
> -Brett
>
> twleung@sauria.com wrote:
> >
> > Brett,
> >
> > This has changed in the 12/17 working draft.  See 4 of the draft.
> >
> > Ted
> > ----- Original Message -----
> > From: Brett McLaughlin <bm...@algx.net>
> > To: <xe...@xml.apache.org>
> > Sent: Thursday, December 30, 1999 8:45 PM
> > Subject: Schemas and Namespaces
> >
> > > Question on Schema within XML:
> > >
> > > So I understand I can have a document like so:
> > >
> > > <?xml version="1.0"?>
> > >
> > > <JavaXML:Doc xmlns:JavaXML="http://www.javaxml.com">
> > >   <JavaXML:element1>
> > >     <JavaXML:element2 />
> > >   </JavaXML:element1>
> > > </JavaXML:Book>
> > >
> > > so I declare my namespace as JavaXML.
> > >
> > > Then I see how I can have my schema defined as so:
> > >
> > > <Doc xmlns="docSchema.xsd">
> > >   <element1>
> > >     <element2 />
> > >   </element1>
> > > </Doc>
> > >
> > > But what I am confused on is how to do both?  Would this be correct?
> > >
> > > <?xml version="1.0"?>
> > >
> > > <JavaXML:Doc xmlns:JavaXML="http://www.javaxml.com"
> > >              xmlns="docSchema.xsd">
> > >   <JavaXML:element1>
> > >     <JavaXML:element2 />
> > >   </JavaXML:element1>
> > > </JavaXML:Doc>
> > >
> > > It seems this wouldn't be right, though as the schema is being applied
> > > to the default namespace, which is never actually referenced, since
all
> > > elements are in the JavaXML namespace.  So does schema validation
> > > occur?  Help is appreciated.
> > >
> > > Thanks,
> > > Brett
> > >
>


Re: Schemas and Namespaces

Posted by Ted Leung <tw...@sauria.com>.
----- Original Message -----
From: "Brett McLaughlin" <bm...@algx.net>
To: "Ted Leung" <tw...@sauria.com>
Cc: <xe...@xml.apache.org>
Sent: Tuesday, January 04, 2000 11:02 AM
Subject: Re: Schemas and Namespaces


> Ted Leung wrote:
> >
> > I see that Henry Thompson has answered your question over in xml-dev.
> > In general, questions like this are more appropriate for xml-dev, since
some
> > of
> > the people from the Schema Working Group actually hang out there.
>
> Yeah, thanks.  I figured that out when I got an answer over there in
> about 30 seconds from the WG folks ;-)
>
> >
> > Questions about the Xerces implementation of schema are definitely
> > appropriate
> > here.
>
> Actually, I have one.  What is the plan (and is help needed) on catching
> Xerces up to the 12/17 schema rec. for validation?
>

We're definitely trying to get Xerces up the 12/17 draft (and successive
drafts).
The holidays have contributed to some slowness on this.  The other thing is
that
lots of parts of the spec have changed, and in ways that will force major
changes
in the way that validation currently works.


Re: Schemas and Namespaces

Posted by Brett McLaughlin <bm...@algx.net>.
Ted Leung wrote:
> 
> I see that Henry Thompson has answered your question over in xml-dev.
> In general, questions like this are more appropriate for xml-dev, since some
> of
> the people from the Schema Working Group actually hang out there.

Yeah, thanks.  I figured that out when I got an answer over there in
about 30 seconds from the WG folks ;-)

> 
> Questions about the Xerces implementation of schema are definitely
> appropriate
> here.

Actually, I have one.  What is the plan (and is help needed) on catching
Xerces up to the 12/17 schema rec. for validation?

-Brett

>