
May 28th, 2004, 01:00 PM
|
|
Registered User
|
|
Join Date: Feb 2003
Location: Halifax, Nova Scotia, Canada, North America, Planet Earth, (Inner) Sol System, Milky Way Galaxy, Universe
Posts: 15
Time spent in forums: 18 m 27 sec
Reputation Power: 0
|
|
XML Schema(s): Help Needed
I have the following schema, which I believe needs to be fleshed out more to make it more powerful, can someone please help and also point me in the right direction...hopefully once my project gets approved on SourceForge I will be adding this as well as something else I have to the project. Anyeverhow, here is the schema as it stands right now:
Code:
<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="student">
<xs:complexType>
<xs:sequence>
<xs:element name="stunum" type="xs:integer" />
<xs:element name="lastname" type="xs:string" />
<xs:element name="firstname" type="xs:string" />
<xs:element name="age" type="xs:integer" />
<xs:element name="dateborn" type="xs:date" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="address">
<xs:complexType>
<xs:sequence>
<xs:element name="pnum" type="xs:integer" />
<xs:element name="addnum" type="xs:integer" />
<xs:element name="street" type="xs:string" />
<xs:element name="city" type="xs:string" />
<xs:element name="country" type="xs:string" />
<xs:element name="poczip" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
If you can make any changes to it, please do...any and all help would be very much appreciated.
Someone said the following to me as well, although I am having problems understanding what he is implying, probably because he didn't include an example:
Quote:
In your case, it depends on where you're going with this, but I'd consider creating a ComplexType for a "person" and then define your "Student" as an extension of the Person type, adding perhaps the student ID. That way, if you added Instructor, you'd be able to re-use the generalized part of the definition of a person (since Instructors and Students both have some things in common). |
---
Michael Lauzon, Founder
The Quill Society
http://www.quillsociety.org/
mlauzon@quillsociety.org
|