[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Newbie - Schemas - Problem with minOccurs? or xmlns?
- From: "Stout, Joel R" <Stout.Joel@emeryworld.com>
- To: "'xml-dev@lists.xml.org'" <xml-dev@lists.xml.org>
- Date: Tue, 24 Jul 2001 17:40:15 +0000
Hello,
I've been working with XML for a little while but just started to work with
Schemas yesterday. I am having some problems with my first attempt (big
surprise). Basically I am just trying to get a simple document to validate
to make sure I know the basics. I am checking the document by using a
little VB app I wrote for checking DTDs (so I know the program works).
Below are my XML and XSD contents. The XSD is in my wwwroot folder and PWS
is turned on. The problem is when I say minOccurs="8", there is no error
during validation. There should be because there's only 2 person elements.
I am pretty sure the document is not being checked by the schema at all.
Any help would be great.
Joel
p.s. Thanks again Jim.
------------------------addrbk.xml
<?xml version="1.0"?>
<addressBook xmlns="http://mymachine/schema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://mymachine/schema
http://mymachine/schema.xsd">
<owner>
<cname>Joel Stout</cname>
<email>Stout.Joel@emeryworld.com</email>
</owner>
<person>
<cname>Harrison Ford</cname>
<email>hford@famous.org</email>
</person>
<person>
<cname>Julia Roberts</cname>
<email>jr@pw.com</email>
</person>
</addressBook>
------------------------schema.vsd
<?xml version="1.0"?>
<schema xmlns="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://mymachine/schema.xsd"
targetNamespace="http://mymachine/schema.xsd"
elementFormDefault="qualified"
attributeFormDefault="unqualified">
<complexType name="record">
<sequence>
<element name="cname" type="xsd:string"/>
<element name="email" type="xsd:string"/>
</sequence>
</complexType>
<element name="addressBook">
<complexType>
<sequence>
<element name="owner" type="record"/>
<element name="person" type="record"
minOccurs="8" maxOccurs="unbounded"/>
</sequence>
</complexType>
</element>
</schema>