Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > XML > XML query - schema included

Thread Tools

XML query - schema included

Colin McGuire
Posts: n/a
Hello, I have the following schema defined to validate XML that has
lots of students in a school, and each student has an age and a
Here is my schema - I cannot figure out how to put in the schema that
the studentID must be unique (two students cannot have the same ID).

<xsd:schema xmlnssd="">
<xsd:element name="school">
<xsd:element name="student" minOccurs="1" maxOccurs="3260">
<xsd:element name="age" type="xsd:integer"/>
<xsd:element name="studentID" type="xsd:integer"/>

I am thinking to make the studentID unique I have to put this in (I
dont know whether this is correct but think it is), but I do now know

<xsd:unique name="UniqueStudentConstraint">
<xs:selector xpath="student"/>
<xs:field xpath="@studentID"/>

Thank you
Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
web.xml / XML schema issue, why do some XML schema attributes disappear Java 3 02-20-2007 09:56 AM
Validation with XSD using XML::LibXML::Schema, and XML::Validator::Schema Perl Misc 5 11-29-2006 12:37 PM
[XML Schema] Including a schema document with absent target namespace to a schema with specified target namespace Stanimir Stamenkov XML 3 04-25-2005 09:59 AM
XML Schema to XML Schema Conversion Hari Om XML 1 03-02-2004 09:04 PM
XML schema regular expressions question and recommended XML Schema book Fred Smith XML 1 02-05-2004 11:12 AM