【发布时间】:2019-03-28 10:25:47
【问题描述】:
我有一个定义复杂类型并设置了targetNamespace 属性的XSD。 TestElement 不会获得targetNamespace 设置的命名空间是否正确?它应该从复杂类型afn:ElementType 和http://anotherfancy.namespace 中获得命名空间,对吧?
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:sfn="http://somefancy.namespace"
xmlns:afn="http://anotherfancy.namespace"
attributeFormDefault="unqualified"
elementFormDefault="qualified"
targetNamespace="http://somefancy.namespace"
version="1.0">
<xs:import namespace="http://anotherfancy.namespace" schemaLocation="..."/>
<xs:element name="MyComplexType">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" name="TestElement" type="afn:ElementType">
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
【问题讨论】:
标签: xml xsd xsd-validation xml-validation