开发者

targetNamespace in XML schema causes groups to be invisible

When I specify targetNamespace in XML Schema, I receiv开发者_Python百科e errors (MS Visual Studio Editor and XSD Tool) "undeclared model group 'group name'". I've even tried group example from W3Schools but all the same.

When I remove targetNamespace attribute - everything ok.

Any ideas?

<?xml version="1.0" encoding="utf-8"?>
<xs:schema attributeFormDefault="unqualified" elementFormDefault="unqualified" xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="ns">

<xs:group name="persongroup">
  <xs:sequence>
    <xs:element name="firstname" type="xs:string"/>
    <xs:element name="lastname" type="xs:string"/>
    <xs:element name="birthday" type="xs:date"/>
  </xs:sequence>
</xs:group>

<xs:element name="person" type="personinfo"/>

<xs:complexType name="personinfo">
  <xs:sequence>
    <xs:group ref="persongroup"/>
    <xs:element name="country" type="xs:string"/>
  </xs:sequence>
</xs:complexType>

</xs:schema>


The references to groups / types must be namespace qualified if targetNamespace is used. reference

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜