Vir*_*721 1 xml documentation xsd editor
使用XSD,我可以确保XML文件有效,但是还有一种方法,使用XSD将信息附加到元素和属性,以便打开XML和XSD文件的软件能够显示该描述到用户点击正在描述的元素时?
你正在描述这个xsd:documentation
元素.
二者xsd:documentation
并xsd:appinfo
可以包括一个内xsd:annotation
元件:
xsd:documentation
向用户提供元信息.xsd:appinfo
向应用程序提供元信息.在W3C XML Schema的0部分:入门第二版有一个介绍说明这里,他们提供了如何使用下面的例子xsd:documentation
:
<xsd:element name="internationalPrice">
<xsd:annotation>
<xsd:documentation xml:lang="en">
element declared with anonymous type
</xsd:documentation>
</xsd:annotation>
<xsd:complexType>
<xsd:annotation>
<xsd:documentation xml:lang="en">
empty anonymous type with 2 attributes
</xsd:documentation>
</xsd:annotation>
<xsd:complexContent>
<xsd:restriction base="xsd:anyType">
<xsd:attribute name="currency" type="xsd:string"/>
<xsd:attribute name="value" type="xsd:decimal"/>
</xsd:restriction>
</xsd:complexContent>
</xsd:complexType>
</xsd:element>
Run Code Online (Sandbox Code Playgroud)