- From: Kai Ojansuu <clapu@pori.tut.fi>
- Date: Wed, 13 Mar 2002 10:24:07 -0500 (EST)
- To: xmlschema-dev@w3.org
Hi!
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="..."/>
</request-params>
...
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"
Cheers
Kai Ojansuu
Received on Thursday, 14 March 2002 12:40:12 UTC