使用 XSD,是否可以限制节点内的总文本。在下面的示例中,我希望地址节点内容限制为 255 个字符。
<Address>
<Line1>Text</Line1>
<Line2>Text</Line2>
<City></City>
<Street></Street>
<State></State>
<Country></Country>
</Address>
因此,如果我的地址中只有 Line1 和 Line2 并且 City、Street、State 和 Country 为空,那么 Line1 可能是 254 个字符,而 Line2 将是 1 个字符。
是否可以在 xsd 本身内设置此类约束/限制?