J
Jamie Chen
Hello, need some help to understand this.(I am using DevSutio.Net)
I set the default name space to be "http://www.w3.org/2001/XMLSchema"
in my XML schema and I use my XML schema as the default namespace in
XML instance doc. But it turns out to invlaid. Need some help to
understand why.
Many thanks
///// Here is my schema
<?xml version="1.0" encoding="utf-8" ?>
<schema targetNamespace="http://tempuri.org/XMLSchema.xsd"
xmlns:jchen="http://tempuri.org/XMLSchema.xsd"
xmlns="http://www.w3.org/2001/XMLSchema"> <<=I made this as my
default namespace
<complexType name="personType">
<sequence>
<element name="FirstName" type="string" />
<element name="LastName" type="string" />
</sequence>
</complexType>
<complexType name="peopleType">
<sequence maxOccurs="unbounded">
<element name="Person" type="jchenersonType" />
</sequence>
</complexType>
<element name="People" type="jcheneopleType"></element>
</schema>
//// I then test my schema in DevStudio.Net and it becomes invalid
<?xml version="1.0" encoding="utf-8" ?>
<People xmlns="http://tempuri.org/XMLSchema.xsd"> <<=Use my schema as
default
<Person>
<FirstName> Jamie </FirstName>
<LastName> Chen </LastName>
</Person>
<Person>
<FirstName> Jonathan </FirstName>
<LastName> Chen </LastName>
</Person>
<People>
///// Person tag cannnot be found, this is very strange
I set the default name space to be "http://www.w3.org/2001/XMLSchema"
in my XML schema and I use my XML schema as the default namespace in
XML instance doc. But it turns out to invlaid. Need some help to
understand why.
Many thanks
///// Here is my schema
<?xml version="1.0" encoding="utf-8" ?>
<schema targetNamespace="http://tempuri.org/XMLSchema.xsd"
xmlns:jchen="http://tempuri.org/XMLSchema.xsd"
xmlns="http://www.w3.org/2001/XMLSchema"> <<=I made this as my
default namespace
<complexType name="personType">
<sequence>
<element name="FirstName" type="string" />
<element name="LastName" type="string" />
</sequence>
</complexType>
<complexType name="peopleType">
<sequence maxOccurs="unbounded">
<element name="Person" type="jchenersonType" />
</sequence>
</complexType>
<element name="People" type="jcheneopleType"></element>
</schema>
//// I then test my schema in DevStudio.Net and it becomes invalid
<?xml version="1.0" encoding="utf-8" ?>
<People xmlns="http://tempuri.org/XMLSchema.xsd"> <<=Use my schema as
default
<Person>
<FirstName> Jamie </FirstName>
<LastName> Chen </LastName>
</Person>
<Person>
<FirstName> Jonathan </FirstName>
<LastName> Chen </LastName>
</Person>
<People>
///// Person tag cannnot be found, this is very strange