xml - XSD 1.1 assert attribute must be present in document -


using xsd 1.1 possible assert attribute exists somewhere else.

example:

<root>   <someelement>     <lookup name="test"/>     <bla>       <lookup name="tbl2"/>       <morebla>         <evenmore>           <lookup name="tbl2"/>         </evenmore>       </morebla>     </bla>   </someelement>   <table name="test">     ...   </table>   <table name="tbl2">     ...   </table> </root> 

how assert element lookup has name used in table element?

the assert need on root element since it's not possible assert element tree, how assert on every lookup element regardless of in document structure?

have in mind in xpath 2.0 comparing $s1 = $sequence2 returns true if , if $s1 (or of elements if sequence) exists in $sequence2. can use simple xpath test assert:

every $lookupname in descendant-or-self::lookup/@name satisfies $lookupname = descendant-or-self::table/@name 

Comments

Popular posts from this blog

javascript - Bootstrap Popover: iOS Safari strange behaviour -

Website Login Issue developed in magento -

Can the constants be defined inside a model file of a framework in PHP? -