This is a very bizarre XML design, and XSD is not designed to enable validation of bizarre XML designs. It can of course be done using XSD 1.1 assertions: something like <xs:assert test="every $a in $value/@* satisfies name($a) = 'id' or name($a) = 'link1' or (matches(name($a), 'link[0-9]+' and exists($value/@*[name() = concat('link', number(substring-after(name($a), 'link'))-1)))"/> Michael Kay Saxonica
|