xml - Child's attribute depends on parent's attribute in XSD -


considering below xml code

<panel col="2">     <label value="old password" />     <text id="oldpass" /> </panel> 

now want declare xsd file above xml, , want when panel's attribute col greater zero, of elements inside have special colspan attribute , when not true don't have colspan attribute.

how can achieve goal?

in xsd 1.1, inside complextype of panel use assertion test

<xs:assert test="(@col > 0)  , (./child::*[@colspan])"/> <xs:assert test="(@col <= 0)  , (count(./child::*[@colspan]) = 0)"/> 

Comments

Popular posts from this blog

Magento/PHP - Get phones on all members in a customer group -

php - .htaccess mod_rewrite for dynamic url which has domain names -

Website Login Issue developed in magento -