W3C home > Mailing lists > Public > xmlschema-dev@w3.org > March 2002


From: Kai Ojansuu <clapu@pori.tut.fi>
Date: Wed, 13 Mar 2002 10:24:07 -0500 (EST)
To: xmlschema-dev@w3.org
Message-id: <Pine.GSO.4.05.10203131653350.22712-100000@frodo.pori.tut.fi>
Is there a way of implementing a xpath-like content-checking in XMLSchema?
I have an application that produces this kind of xml:
<request-params xsi:type="showstudent">
 <param name="foo" value="bar"/>
 <param name="id" value="234" />
 <param name="..." value="..."/>

For example this doc is valid only if it has one param-element with
name-attribute valued 'id'
I first created an abstract request-params element which can contain
{0-unbounded} param elements in sequence. Then I created a showstudent
-type element by extension from 'request-params' element and tried to
'fix' only one 'param'-element's name to 'id'. The validator (Xerces)
notifies that every param's name-attribute should be 'id'.

xpath-check would be something like this: "count(param[@name='id']) = 1"
Kai Ojansuu
Received on Thursday, 14 March 2002 12:40:12 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 14:55:55 UTC