Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
假设我有一组在 complexType 中定义的断言,如何在另一个 complexType 或元素中重用相同的断言?
使用类型扩展/限制时断言会被继承吗?
我能想到的唯一方法是在 dtd 实体中定义断言条件,然后在需要时重用它们。
如果类型之间存在逻辑关系,那么您也许可以使这两种类型成为某个抽象超类型的子类型。
否则,正如您所说,您将留下 DTD 实体或其他文本嵌入机制。