OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   is it a bug,or i m wrong?

[ Lists Home | Date Index | Thread Index ]
  • To: "Henry S. Thompson" <ht@cogsci.ed.ac.uk>
  • Subject: is it a bug,or i m wrong?
  • From: =?gb2312?B?ZmNft72zrA==?= <fangc@bsoft.com.cn>
  • Date: Thu, 8 May 2003 09:37:46 +0800
  • Cc: <xml-dev@lists.xml.org>
  • Thread-index: AcMO/LK53ftVR0M+S9ihedmwQ6hZMQF/+gtA
  • Thread-topic: is it a bug,or i m wrong?

Hi

I had a post in 2003-4-29, said I m could import a abstract complex type and derived from that complex type. And thanks Mr. Henry S. Thompson, he give me the advice that I use the same target namespace in import file.
Well, after I using the different target Namespace, the problem still exists.
I could not find any mistake I have made in the file. So I think maybe it's the parser's bug,and I fix the MSXML 4.0 Service Pack 2,but the issue still occur.
What could I do?
This problem has tortured me for a whole week.
Is it a bug? Or are these file correct?
Could anyone help me?

Here is the file.
main.xsd
<xs:schema targetNamespace="http://www.test.com/"; xmlns="http://www.test.com/";  xmlns:xs="http://www.w3.org/2001/XMLSchema"; elementFormDefault="qualified">
	<xs:simpleType name="PowerEnum">
		<xs:restriction base="xs:string">
			<xs:enumeration value="1Pounds"/>
			<xs:enumeration value="2Pounds"/>
			<xs:enumeration value="300Pounds"/>
		</xs:restriction>
	</xs:simpleType>
	<xs:complexType name="Man" abstract="true">
		<xs:sequence>
			<xs:element name="Name" type="xs:string"/>
			<xs:element name="Power" type="PowerEnum"/>
		</xs:sequence>
	</xs:complexType>
</xs:schema>

main_derive.xsd
<xs:schema xmlns="http://www.test.com/ok"; targetNamespace="http://www.test.com/ok"; xmlns:xs="http://www.w3.org/2001/XMLSchema"; xmlns:im="http://www.test.com/"; elementFormDefault="qualified">
	<xs:import namespace="http://www.test.com/"; schemaLocation="main.xsd"/>
	<xs:complexType name="SuperMan">
		<xs:complexContent>
			<xs:restriction base="im:Man">
				<xs:sequence>
					<xs:element name="Name" type="xs:string"/>
					<xs:element name="Power">
						<xs:simpleType>
							<xs:restriction base="im:PowerEnum">
								<xs:enumeration value="300Pounds"/>
							</xs:restriction>
						</xs:simpleType>
					</xs:element>
				</xs:sequence>
			</xs:restriction>
		</xs:complexContent>
	</xs:complexType>
	<xs:element name="test">
		<xs:complexType>
			<xs:sequence>
				<xs:element name="OneMan" type="SuperMan"/>
				<xs:element name="ok" type="xs:string"/>
			</xs:sequence>
		</xs:complexType>
	</xs:element>
</xs:schema>

what could I do?
I check the file for hundreds of times. But no miracle happened. How depress I was!
Best Regards
fbeyond
-----邮件原件-----
发件人: Henry S. Thompson [mailto:ht@cogsci.ed.ac.uk] 
发送时间: 2003年4月30日 17:40
收件人: fc_方超
抄送: xml-dev@lists.xml.org
主题: Re: [xml-dev] import problem

=?utf-8?B?ZmNf5pa56LaF?= <fangc@bsoft.com.cn> writes:

> Hi,I got a namespace problem.

You're using import for a schema document with the same target
namespace as the importing document -- you should be using include.

See the W3C XML Schema Primer [1] for an example.

ht

[1] http://www.w3.org/TR/xmlschema-0/#SchemaInMultDocs
-- 
  Henry S. Thompson, HCRC Language Technology Group, University of Edinburgh
                      Half-time member of W3C Team
     2 Buccleuch Place, Edinburgh EH8 9LW, SCOTLAND -- (44) 131 650-4440
	    Fax: (44) 131 650-4587, e-mail: ht@cogsci.ed.ac.uk
		     URL: http://www.ltg.ed.ac.uk/~ht/
 [mail really from me _always_ has this .sig -- mail without it is forged spam]




 

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS