I think this functionality does not exist, but I thought I wanted to give it a final shot.
I have an XML structure that I am trying to validate (I have no control over this structure).
I can have several "condition" tags in this structure, each tag has a characteristic "type" and then depending on the remaining attributes of that tag, so what is the type of such that if for example Looks like:
& lt; Condition type = "power" maximum = "3" & gt; & Lt; Effect type = "add" value = "2" /> & Lt; / Status & gt; & Lt; Condition Type = "Greater" minAmount = "1" & gt; & Lt; Effect type = "conversion" verb = "SCU" value = "4" /> & Lt; Impact type = "conversion" action = "section" value = "3" /> & Lt; / Status & gt; & Lt; Condition type = "range" minAmount = "1" maxAmount = "3" & gt; & Lt; Impact type = "YouGetTheDrift" /> & Lt; / Status & gt; Then if it is a low type type, then it only requires a maximum alarm tag and so on.
There is no way to make its properties necessary / alternative / prohibited basis. The last attribute, hey?
I tried to make an option with many types of tags, with certain type types and custom attribute set per type, but it complained about the tags with the same name.
The name of the feature you are describing is "co-manifestation constraints", and that XSD Not supported in 1.0.
You can do this in "XSD 1.1" using the "conditional type assignment" syntax, where the type of element depends on the values of its properties; You can also do this by claiming XSD 1.1 is now a last W3C recommendation and it has been implemented in XS and Suxan.
Comments
Post a Comment