Restricting XML Elements Based on Another Element via XSD

前端 未结 2 1144
灰色年华
灰色年华 2020-11-27 22:13

I believe this has to do with keyref but I\'m not for sure, and I am really not sure that it can be done at all.

For example, say I have myElement1 and

2条回答
  •  隐瞒了意图╮
    2020-11-27 23:10

    What I would suggest is to create XSD for each cases defined below:

    Cases like:

    1. Validating Element depending on the value or presence of any other element/attribute.
    2. Validating value of an element depending on the value or presence of any other element/attribute.
    3. Validating attribute depending on the value or presence of any other element/attribute.
    4. Ignoring (random) elements/attributes from validation isn't allowed. (I mean to say is usage of has restrictions.)
    5. Elements/attributes of same name having different DataTypes.
    6. Validating child elements on the basis of value or presence of any other Elements/Attributes.

    And create there own XML for that.

提交回复
热议问题