[Home] [By Thread] [By Date] [Recent Entries]

  • From: Rick Jelliffe <rjelliffe@a...>
  • To: xml-dev@l...
  • Date: Thu, 22 Mar 2007 21:50:29 +1100

In Schematron, you might do something roughly like this,:

<pattern>
   <rule context="anElement">
       <assert test="@port != @debug-port">
       The port number must be different from the debug port number.
       </assert>
       <assert test="not( preceding::anElement[@port= current()/@port or 
@debug-port=current()/@port or
                       @port=current()/@debug-port ][ @debug-port = 
current()/@debug-port ])">
       A number can only be assigned once, either as a port or as a 
debug port.
       </assert>
    </rule>
</pattern>

If the anElement are in the same parent, then use preceding-sibling::  axis.

Cheers
Rick Jelliffe


[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]


Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member