RE: <xsd:any> misunderstandings?

Hi Saul,

Are you specifing a schemaLocation in your instance?  It has to know where
to go look for the declaration for xsd:schema.

So, it might look like:

<types xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation="http://www.w3.org/2001/XMLSchema
                           xmlschema.xsd">
	<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" />
</types>

(if you have a local copy of the schema for schemas at xmlschema.xsd)

Also, what parser are you using?  Maybe it's a bug.


Priscilla

-----------------------------------------------------------
Priscilla Walmsley                   priscilla@walmsley.com
Vitria Technology                     http://www.vitria.com
Author, Definitive XML Schema    (Prentice Hall, Dec. 2001)
-----------------------------------------------------------

> -----Original Message-----
> From: xmlschema-dev-request@w3.org
> [mailto:xmlschema-dev-request@w3.org]On Behalf Of Saul Farber
> Sent: Thursday, November 08, 2001 11:23 AM
> To: xmlschema-dev@w3.org
> Subject: Re: <xsd:any> misunderstandings?
>
>
> Thanks for your suggestions, guys, but I think I have already
> taken care
> of those issues...plus I think I mis-copied my xml to my first post.
> Sorry!  I'll try to spell out the problem in more detail.
>
> WSDL:
>
> <types>
> 	<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" />
> </types>
>
> WSDL-Schema: (***copied from the OFFICIAL wsdl-schema***)
> *** the declared namespace here is
> xmlns="http://www.w3.org/2001/XMLSchema ***
>
> <element name="types" type="wsdl:typesType"/>
> <complexType name="typesType">
>   <complexContent>
>     <extension base="wsdl:documented">
>       <sequence>
>         <any namespace="##other" minOccurs="0" maxOccurs="unbounded"/>
>       </sequence>
>     </extension>
>   </complexContent>
> </complexType>
>
> so my <xsd:schema> element is in an "other" namespace (namely the
> xml-schema ns) and it is valid (it is a validatable element from the
> http://www.w3.org/2001/XMLSchema namespace).
>
> Yet I still get the:
> Error on line 20 of document /home.../document.xml: Element type
> "xsd:schema" must be declared.
> error.  Like I said below, isn't the point of the xsd:all element to
> allow for arbitrary sub-documents?
>
> Argh!
>
> any further suggestions?
>
> --saul
>
> On Wed, 2001-11-07 at 22:02, Eddie Robertsson wrote:
> > > When defining WSDL types, one uses a bit of XML like the
> following:
> > >
> > > <types>
> > >         <xsd:schema xmlns="http://www.w3.org/2001/XMLSchema">
> > >                 ...
> > >         </xsd:schema>
> > > </types>
> >
> > Try changing the namespace declaration to
> > 'xmlns:xsd="http://www.w3.org/2001/XMLSchema"'
> > As it is now you're declaring the default namespace to
> point to XML Schema but
> > you still have no definition for the xsd: prefix (unless
> you have one further
> > up in the tree structure...)
> >
> > Cheers,
> > /Eddie
> >
> > >
> > >
> > > The definition of the "types" element in the WSDL-schema
> (version 1.1)
> > > is as follows (from http://schemas.xmlsoap.org/wsdl/):
> > >
> > > <element name="types" type="wsdl:typesType"/>
> > > <complexType name="typesType">
> > >   <complexContent>
> > >     <extension base="wsdl:documented">
> > >       <sequence>
> > >         <any namespace="##other" minOccurs="0"
> maxOccurs="unbounded"/>
> > >       </sequence>
> > >     </extension>
> > >   </complexContent>
> > > </complexType>
> > >
> > > So I wrote the following xml (to conform to this schema),
> thinking that
> > > the <any> element would let me write xml like the above...with the
> > > correct namespace, etc.
> > >
> > > However, when validating, I get the following error
> > > >> Error on line 20 of document /home.../document.xml:
> Element type
> > > "xsd:schema" must be declared.
> > >
> > > I thought the whole point of having an <xsd:any> tag was
> to ELIMINATE
> > > the need to pre-declare exactly was is to go into the xml!  My
> > > <xsd:schema> structure is both well-formed and valid, I
> just can't seem
> > > to get the <xsd:any> element to "accept" an un-declared child.
> > >
> > > I can always fix this by setting the "processContents"
> attribute of the
> > > <any> element to "skip", but this defeats what I want to
> do...which is
> > > have valid xml-schema in the <types> section of the WSDL.
> > >
> > > What am I missing here...is my understanding of exactly
> what <xsd:any>
> > > does wrong?>
> > >
> > > thanks in advance!
> > > saul
> > >
> > > --
> > > Syncline, Inc.
> > > 373 Washington St.
> > > Boston, MA  02108
> > >
> > > 617-986-1000 (x248)
> > >
> > > www.syncline.com -- Informing the Enterprise
> > > www.mapciti.com -- It's Your Town on the Web
> > >
> > >
> --------------------------------------------------------------
> ----------
> > >    Part 1.2Type: application/pgp-signature
> >
> >
> --
> Syncline, Inc.
> 373 Washington St.
> Boston, MA  02108
>
> 617-986-1000 (x248)
>
> www.syncline.com -- Informing the Enterprise
> www.mapciti.com -- It's Your Town on the Web
>

Received on Thursday, 8 November 2001 11:51:40 UTC