第2章 使用XML模式.ppt

第2章 使用XML模式

所有属性默认都是可选的。如需明确地规定属性为可选,使用 use 属性optional : xs:attribute name=lang type=xs:string use=optional/ Required 使属性成为必需的属性: xs:attribute name=lang type=xs:string use=required/ * xsd:element name=blank xsd:complexType xsd:attribute name=temperature type=xsd:decimal fixed=32.0/ /xsd:complexType /xsd:element 有效的XML: blank temperature=32.0/blank/ !-- temperature=32.0 -- 无效的 XML: blank temperature=34.0/ * 全局属性声明是schema文档的顶级结构中,也就是说,它的父元素是schema,那么这些属性为全局属性,在模式文档中必须是唯一的。利用attribute标记符的ref属性来引用。 局部属性声明只出现在复杂元素定义中,它们仅

文档评论(0)

1亿VIP精品文档

相关文档