Attribute use depending on attribute value

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • janbp
    New Member
    • May 2007
    • 1

    Attribute use depending on attribute value

    Hi,

    I just want to know how I would do the following:
    <root>
    <test type=”1” value=”1” display=”disp”/>
    <test type=”2” value=”100” />
    </root>

    I want the ‘display’ attribute to be available for use depending on what the value for the ‘type’ attribute is.

    How can I do this in a XSD (XML schema)??

    Thanks you in advance
  • dorinbogdan
    Recognized Expert Contributor
    • Feb 2007
    • 839

    #2
    Welcome to TheScripts TSDN....

    It may be possible, but I'm not sure (never heard about a similar case).

    If set the attribute display="none" is not the same result you are looking for?
    Or, you could use XSL to validate the XML data (see this XSL compact tutorial).

    Comment

    Working...