【发布时间】:2014-10-24 09:33:11
【问题描述】:
有没有办法限制混合内容元素的内容长度,或者有其他方法可以做到吗?
我希望 Relax ng 架构要求“属性”元素内的文本(在下面的示例 XML 中)限制为一定数量的字符。
示例 XML:
<attribute>
, <tag>ART_QUANTITY</tag> single page etc.
Any number of characters is currently accepted here...
I would like to restrict this to the same number of characters
as in the source of this text, which is a database field.
</attribute>
我当前的 Relax ng 架构,不关心长度。
<element name="attribute">
<mixed>
<!-- The text may contain references to other fields, which we indicate (surrond) with a tag -->
<zeroOrMore>
<element name="tag">
<data type="NMTOKEN"/>
</element>
</zeroOrMore>
</mixed>
</element>
【问题讨论】:
标签: xml xsd constraints relaxng