我被要求记录一个XML Schema文件。我需要包括每个模式元素的业务和技术描述。看着我们的指南和W3C XML Schema建议,我想知道最好的实践到底是什么。
我们的指导方针规定注释标记应具有以下格式:
<xs:annotation>
<xs:documentation source="BusinessDescription">This is the business description</xs:documentation>
<xs:documentation source="TechnicalDescription">This is the business description</xs:documentation>
</xs:annotation>XML建议源属性的类型应该是"xs:anyURI“。显然,"BuinessDescription“和"TechnicalDescription”不是URI,它们将在整个模式中重复出现。因此,使用源属性作为语义属性真的正确吗?
在XML Schema http://shop.oreilly.com/product/9780596002527.do中,Eric van der Vlist建议这是可以接受的,但也与这种观点相矛盾,因为它可能导致互操作性问题。
发布于 2012-10-02 08:16:57
您可以将格式良好的xml放在其中,而不仅仅是文本,这样就不需要对已知的标准属性进行杂乱处理。只要有<Business>This is the business...</Business><Technical>This is the technical....</Tecnhical>节点就行了。
https://stackoverflow.com/questions/12682777
复制相似问题