|
[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: Newbie - Schemas - Problem with minOccurs? or xmlns?
Hi Joel,
Your instance looks fine, but there are a couple problems with this latest
copy of your schema document:
1. The target namespace in your schema document
(http://mwa40cj601/schema.xsd) is different from the namespace specified in
your instance document (http://mymachine/schema). These must match exactly.
2. You cannot specify the attribute targetNamespace:my="xxx". You need to
specify both targetNamespace="xxx" and xmlns:my="xxx".
3. Also, you do not need to specify xmlns:xsi in your schema document.
Try the following:
<schema xmlns="http://www.w3.org/2001/XMLSchema"
xmlns:my="http://mymachine/schema"
targetNamespace="http://mymachine/schema"
elementFormDefault="qualified"
attributeFormDefault="unqualified">
<complexType name="record">
<sequence>
<element name="cname" type="string"/>
<element name="email" type="string"/>
</sequence>
</complexType>
<element name="addressBook">
<complexType>
<sequence>
<element name="owner" type="my:record"/>
<element name="person" type="my:record"
minOccurs="8" maxOccurs="unbounded"/>
</sequence>
</complexType>
</element>
</schema>
Hope that helps!
Priscilla Walmsley
Vitria Technology
> -----Original Message-----
> From: Stout, Joel R [mailto:Stout.Joel@e...]
> Sent: Tuesday, July 24, 2001 2:17 PM
> To: 'Jeff Rafter'; Stout, Joel R
> Cc: xml-dev@l...
> Subject: RE: Newbie - Schemas - Problem with minOccurs? or xmlns?
>
>
> Thanks, I corrected those errors in the schema (below) but
> I'm still not
> getting an error during validation. The parse is done with the VB
> DOMDocument object. I have validateOnParse = True but it's
> not catching it.
> This program has worked with DTDs before and the MS
> documentation says that
> it will do schema validation as well. I'll try to find another app to
> validate. Thanks again.
>
> ------------------------schema.vsd
> <?xml version="1.0"?>
> <schema xmlns="http://www.w3.org/2001/XMLSchema"
> xmlns:xsi="http://mwa40cj601/schema.xsd"
> targetNamespace:my="http://mwa40cj601/schema.xsd"
> elementFormDefault="qualified"
> attributeFormDefault="unqualified">
> <complexType name="record">
> <sequence>
> <element name="cname" type="string"/>
> <element name="email" type="string"/>
> </sequence>
> </complexType>
> <element name="addressBook">
> <complexType>
> <sequence>
> <element name="owner" type="my:record"/>
> <element name="person" type="my:record"
> minOccurs="8" maxOccurs="unbounded"/>
> </sequence>
> </complexType>
> </element>
> </schema>
>
>
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|
|||||||||

Cart








