Having both an attribute and a restriction on an element in xml schema

后端 未结 2 1201
遥遥无期
遥遥无期 2020-12-28 15:50

I\'m trying to write a xml schema that will validate this piece of xml:

14 march 2007

The a

相关标签:
2条回答
  • 2020-12-28 15:59

    You can have a element with restriction and attribute(-s). The key is to define custom type with it's restrictions and then using it add attributes to it. Refer here: Content restriction and attribute validation on the same element in XSD

    0 讨论(0)
  • 2020-12-28 16:17

    You cannot merge both a restriction and an extension into one block of XSD. The solution that you have with the "ReviewDate" simple type is the best solution I know of.

    Marc

    0 讨论(0)
提交回复
热议问题