Restricting mixed XML content via XSD? -


i have xml structure

<main>1   <sub>2     <property>red</property>     <function>0       <parameter>234</parameter>     </function>   </sub> </main> 

and want make xsd it. know how if there no "1" behind "main", no "2" behind "sub" , no "0" behind "function". don't know how if there is.

can me add restriction xml? numbers should not greater 1000.

thanks lot!

it's bad xml design. if want constrain numbers, place them element or attribute of own.

as have it, can use mixed content declaration, you'll lose ability constrain mixed text, numbers in case.

you might able come assertion (xsd 1.1 required, though) on string value or text nodes of parent element of mixed content, that'd messy. change design if adding numeric constraint important you.


Comments

Popular posts from this blog

Command prompt result in label. Python 2.7 -

javascript - How do I use URL parameters to change link href on page? -

amazon web services - AWS Route53 Trying To Get Site To Resolve To www -