开发者

Validate specific XML with XSD

We have specific XML that has specific structure:

<root>
  <element type=”a”>
    <value>someValueA</value>
  </element>
  <element type=”b”>
    <value>someValueB</value>
  </element>
</root>

Is it possible to validate it usi开发者_开发百科ng XSD in such a way that the element with type “a” is required and that of type “b” is not required?


In XSD 1.0 you can't apply different constraints to different sibling elements that have the same element name.

It looks like you need XSD 1.1 assertions - available now in Saxon and Xerces.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜