By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,592 Members | 1,958 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,592 IT Pros & Developers. It's quick & easy.

XmlSchemaSet Compile error ?

P: n/a
Here under 4 schemas i'm working with ( it may be long: sorry...)
The context is the following :
Resident.xsd imports Person.xsd and includes Common.xsd ( anonimous schema:
no TargetNamespace )
Person.xsd includes Common-Naming.xsd ( anonimous schemas )
Common-Naming.xsd includes common.xsd ( both are anonimous schemas )

Compilation of Resident.xsd raise the following exception:
"System.Xml.Schema.XmlSchemaException: The attribute 'oid' already
exists...."

That is wrong : the schemas are valid and well done ( Xml-Spy ).

The problem seems to be that Common.xsd appears twice: one time in
Resident.xsd and an other time in Person.xsd. i tried to put Common.xsd &
Common-Naming.xsd in a same file it doesn't change anything.

Thank for any help because i'm currently freezed in my dev....

<!-- COMMON.XSD -->
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified" attributeFormDefault="unqualified"
id="CommonSpace">
<xs:group name="IEntity">
<xs:sequence>
<xs:element name="Reference" type="xs:string"/>
</xs:sequence>
</xs:group>
<xs:complexType name="BusinessEntityType">
<xs:sequence>
<xs:group ref="IEntity"/>
</xs:sequence>
<xs:attributeGroup ref="ISqlEntity"/>
</xs:complexType>
<xs:complexType name="EntityRefType">
<xs:sequence>
<xs:element name="Reference" type="xs:string"/>
<xs:element name="Description" type="xs:string"/>
</xs:sequence>
<xs:attributeGroup ref="ISqlEntity"/>
</xs:complexType>
<xs:complexType name="RefType">
<xs:complexContent>
<xs:extension base="EntityRefType">
<xs:attribute name="type" type="xs:string"/>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:attributeGroup name="ISqlEntity">
<xs:attribute name="oid" type="xs:string"/>
</xs:attributeGroup>
</xs:schema>
<!-- COMMON-NAMING.XSD -->
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified" attributeFormDefault="unqualified"
id="CommonNamingSpace">
<xs:include schemaLocation="Common.xsd" />
<xs:simpleType name="SexeTypology">
<xs:restriction base="xs:string">
<xs:enumeration value="M" />
<xs:enumeration value="F" />
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="CivilityTypology">
<xs:restriction base="xs:string">
<xs:enumeration value="c1:MRS" />
<xs:enumeration value="c2:MISS" />
<xs:enumeration value="c3:MR" />
<xs:enumeration value="c4:DOC" />
<xs:enumeration value="c5:PROF" />
</xs:restriction>
</xs:simpleType>
<xs:complexType name="CivilityType">
<xs:simpleContent>
<xs:extension base="xs:string">
<xs:attribute name="type" type="CivilityTypology"
default="c3:MR" />
</xs:extension>
</xs:simpleContent>
</xs:complexType>
<xs:complexType name="NameType">
<xs:sequence>
<xs:element name="Civility" type="CivilityType" />
<xs:element name="First" type="xs:string" />
<xs:element name="Last" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:schema>
<!-- PERSON.XSD -->
<xs:schema xmlns="http://copro/Copro.Persons"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://copro/Copro.Persons" elementFormDefault="qualified"
attributeFormDefault="unqualified" id="PersonSpace">
<xs:include schemaLocation="Common-Naming.xsd" />
<xs:simpleType name="FamillyStatus">
<xs:restriction base="xs:string">
<xs:enumeration value="SINGLE" />
<xs:enumeration value="MARIED" />
<xs:enumeration value="WEADOW" />
<xs:enumeration value="UNDEFINED" />
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="CommonSharedActivity">
<xs:restriction base="xs:string">
<xs:enumeration value="Jardinage" />
<xs:enumeration value="Musique" />
<xs:enumeration value="Informatique" />
<xs:enumeration value="Baby-Sisting" />
</xs:restriction>
</xs:simpleType>
<xs:complexType name="PersonType">
<xs:complexContent>
<xs:extension base="BusinessEntityType">
<xs:sequence>
<xs:element name="Name" type="NameType" />
<xs:element name="ArrivalDate" type="xs:date"
minOccurs="0" />
<xs:element name="IsCoproManager" type="xs:boolean"
default="false" minOccurs="0" />
<xs:element name="FamillyStatus" type="FamillyStatus"
default="UNDEFINED" minOccurs="0" />
<xs:element name="BirthDay" type="xs:dateTime"
minOccurs="0" />
<xs:element name="Email" type="xs:string" minOccurs="0" />
<xs:element name="SharedActivity" type="xs:string"
minOccurs="0" maxOccurs="unbounded" />
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:complexType name="PersonRefType">
<xs:complexContent>
<xs:extension base="EntityRefType">
<xs:sequence>
<xs:element ref="Person" minOccurs="0" />
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:element name="Person" type="PersonType">
<xs:unique name="PersonByReference">
<xs:selector xpath="." />
<xs:field xpath="Reference" />
</xs:unique>
</xs:element>
</xs:schema>
<!-- RESIDENT.XSD -->
<xs:schema xmlns="http://copro/Copro.Residents"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:p="http://copro/Copro.Persons"
targetNamespace="http://copro/Copro.Residents" elementFormDefault="qualified"
attributeFormDefault="unqualified" id="ResidentSpace">
<xs:include schemaLocation="Common.xsd"/>
<xs:import namespace="http://copro/Copro.Persons"
schemaLocation="Person.xsd"/>
<xs:complexType name="ResidentType">
<xs:complexContent>
<xs:extension base="BusinessEntityType">
<xs:sequence>
<xs:element name="Copro-Item" type="RefType" maxOccurs="unbounded"/>
<xs:element name="Person" type="p:PersonRefType" maxOccurs="unbounded"/>
<!--
<xs:element ref="p:Person" maxOccurs="unbounded"/>
-->
</xs:sequence>
<xs:attribute name="copro" type="xs:string"/>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:element name="Resident" type="ResidentType"/>
</xs:schema>
Nov 12 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a
Hello Zafar,

First of all thank for your answer :O)

This is a preview platform :
my .net framework is v2.0.50215
I've two platforms with this version of .net framework :
- XP + VS Beta 1
- Server 2003 + SQL Server 2005 CPT June ( running in virtual PC on
previous platform )
both raise the same error.

may i know what is your version ?

"Zafar Abbas" wrote:
I am able to save all 4 files as XSD schemas, and compile Residents.xsd
using the XmlSchemaSet without any problems.
What version of the .net framework are you using and how does your code look
like?

Thanks.
"Brice Prunier" <Br**********@discussions.microsoft.com> wrote in message
news:1B**********************************@microsof t.com...
Here under 4 schemas i'm working with ( it may be long: sorry...)
The context is the following :
Resident.xsd imports Person.xsd and includes Common.xsd ( anonimous

schema:
no TargetNamespace )
Person.xsd includes Common-Naming.xsd ( anonimous schemas )
Common-Naming.xsd includes common.xsd ( both are anonimous schemas )

Compilation of Resident.xsd raise the following exception:
"System.Xml.Schema.XmlSchemaException: The attribute 'oid' already
exists...."

That is wrong : the schemas are valid and well done ( Xml-Spy ).

The problem seems to be that Common.xsd appears twice: one time in
Resident.xsd and an other time in Person.xsd. i tried to put Common.xsd &
Common-Naming.xsd in a same file it doesn't change anything.

Thank for any help because i'm currently freezed in my dev....

<!-- COMMON.XSD -->
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified" attributeFormDefault="unqualified"
id="CommonSpace">
<xs:group name="IEntity">
<xs:sequence>
<xs:element name="Reference" type="xs:string"/>
</xs:sequence>
</xs:group>
<xs:complexType name="BusinessEntityType">
<xs:sequence>
<xs:group ref="IEntity"/>
</xs:sequence>
<xs:attributeGroup ref="ISqlEntity"/>
</xs:complexType>
<xs:complexType name="EntityRefType">
<xs:sequence>
<xs:element name="Reference" type="xs:string"/>
<xs:element name="Description" type="xs:string"/>
</xs:sequence>
<xs:attributeGroup ref="ISqlEntity"/>
</xs:complexType>
<xs:complexType name="RefType">
<xs:complexContent>
<xs:extension base="EntityRefType">
<xs:attribute name="type" type="xs:string"/>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:attributeGroup name="ISqlEntity">
<xs:attribute name="oid" type="xs:string"/>
</xs:attributeGroup>
</xs:schema>
<!-- COMMON-NAMING.XSD -->
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified" attributeFormDefault="unqualified"
id="CommonNamingSpace">
<xs:include schemaLocation="Common.xsd" />
<xs:simpleType name="SexeTypology">
<xs:restriction base="xs:string">
<xs:enumeration value="M" />
<xs:enumeration value="F" />
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="CivilityTypology">
<xs:restriction base="xs:string">
<xs:enumeration value="c1:MRS" />
<xs:enumeration value="c2:MISS" />
<xs:enumeration value="c3:MR" />
<xs:enumeration value="c4:DOC" />
<xs:enumeration value="c5:PROF" />
</xs:restriction>
</xs:simpleType>
<xs:complexType name="CivilityType">
<xs:simpleContent>
<xs:extension base="xs:string">
<xs:attribute name="type" type="CivilityTypology"
default="c3:MR" />
</xs:extension>
</xs:simpleContent>
</xs:complexType>
<xs:complexType name="NameType">
<xs:sequence>
<xs:element name="Civility" type="CivilityType" />
<xs:element name="First" type="xs:string" />
<xs:element name="Last" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:schema>
<!-- PERSON.XSD -->
<xs:schema xmlns="http://copro/Copro.Persons"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://copro/Copro.Persons"

elementFormDefault="qualified"
attributeFormDefault="unqualified" id="PersonSpace">
<xs:include schemaLocation="Common-Naming.xsd" />
<xs:simpleType name="FamillyStatus">
<xs:restriction base="xs:string">
<xs:enumeration value="SINGLE" />
<xs:enumeration value="MARIED" />
<xs:enumeration value="WEADOW" />
<xs:enumeration value="UNDEFINED" />
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="CommonSharedActivity">
<xs:restriction base="xs:string">
<xs:enumeration value="Jardinage" />
<xs:enumeration value="Musique" />
<xs:enumeration value="Informatique" />
<xs:enumeration value="Baby-Sisting" />
</xs:restriction>
</xs:simpleType>
<xs:complexType name="PersonType">
<xs:complexContent>
<xs:extension base="BusinessEntityType">
<xs:sequence>
<xs:element name="Name" type="NameType" />
<xs:element name="ArrivalDate" type="xs:date"
minOccurs="0" />
<xs:element name="IsCoproManager" type="xs:boolean"
default="false" minOccurs="0" />
<xs:element name="FamillyStatus" type="FamillyStatus"
default="UNDEFINED" minOccurs="0" />
<xs:element name="BirthDay" type="xs:dateTime"
minOccurs="0" />
<xs:element name="Email" type="xs:string"

minOccurs="0" />
<xs:element name="SharedActivity" type="xs:string"
minOccurs="0" maxOccurs="unbounded" />
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:complexType name="PersonRefType">
<xs:complexContent>
<xs:extension base="EntityRefType">
<xs:sequence>
<xs:element ref="Person" minOccurs="0" />
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:element name="Person" type="PersonType">
<xs:unique name="PersonByReference">
<xs:selector xpath="." />
<xs:field xpath="Reference" />
</xs:unique>
</xs:element>
</xs:schema>
<!-- RESIDENT.XSD -->
<xs:schema xmlns="http://copro/Copro.Residents"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:p="http://copro/Copro.Persons"
targetNamespace="http://copro/Copro.Residents"

elementFormDefault="qualified"
attributeFormDefault="unqualified" id="ResidentSpace">
<xs:include schemaLocation="Common.xsd"/>
<xs:import namespace="http://copro/Copro.Persons"
schemaLocation="Person.xsd"/>
<xs:complexType name="ResidentType">
<xs:complexContent>
<xs:extension base="BusinessEntityType">
<xs:sequence>
<xs:element name="Copro-Item" type="RefType" maxOccurs="unbounded"/>
<xs:element name="Person" type="p:PersonRefType" maxOccurs="unbounded"/>
<!--
<xs:element ref="p:Person" maxOccurs="unbounded"/>
-->
</xs:sequence>
<xs:attribute name="copro" type="xs:string"/>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:element name="Resident" type="ResidentType"/>
</xs:schema>


Nov 12 '05 #2

P: n/a
Hello,

Just for info i run the program again : here is the console output :

Current dir: D:\Projects\Copro\Copro.Schemas\bin\Debug
Current dir: D:\Projects\Copro\Copro.Schemas
loading: Resident.xsd
loaded: Resident.xsd
loaded schemas : 2
System.Xml.Schema.XmlSchemaException: The attribute 'oid' already exists.
System.Exception: Compile error ---> System.Xml.Schema.XmlSchemaException:
The attribute 'oid' already exists.
--- End of inner exception stack trace ---
at Schema.Program.schemaSet_ValidationEventHandler(Ob ject sender,
ValidationEventArgs e) in D:\Projects\Copro\Copro.Schemas\Program.cs:line 58
at System.Xml.Schema.BaseProcessor.SendValidationEven t(XmlSchemaException
e, XmlSeverityType severity)
at System.Xml.Schema.Compiler.CompileLocalAttributes( XmlSchemaComplexType
baseType, XmlSchemaComplexType derivedType, XmlSchemaObjectCollection
attributes, XmlSchemaAnyAttribute anyAttribute, XmlSchemaDerivationMethod
derivedBy)
at System.Xml.Schema.Compiler.CompileComplexType(XmlS chemaComplexType
complexType)
at System.Xml.Schema.Compiler.Compile()
at System.Xml.Schema.Compiler.Execute(XmlSchemaSet schemaSet, Boolean
compileContentModel, SchemaInfo schemaCompiledInfo)
at System.Xml.Schema.XmlSchemaSet.Compile()
at Schema.Program.Main(String[] args) in
D:\Projects\Copro\Copro.Schemas\Program.cs:line 40
Compile failed...

regards

"Zafar Abbas" wrote:
I am able to save all 4 files as XSD schemas, and compile Residents.xsd
using the XmlSchemaSet without any problems.
What version of the .net framework are you using and how does your code look
like?

Thanks.
"Brice Prunier" <Br**********@discussions.microsoft.com> wrote in message
news:1B**********************************@microsof t.com...
Here under 4 schemas i'm working with ( it may be long: sorry...)
The context is the following :
Resident.xsd imports Person.xsd and includes Common.xsd ( anonimous

schema:
no TargetNamespace )
Person.xsd includes Common-Naming.xsd ( anonimous schemas )
Common-Naming.xsd includes common.xsd ( both are anonimous schemas )

Compilation of Resident.xsd raise the following exception:
"System.Xml.Schema.XmlSchemaException: The attribute 'oid' already
exists...."

That is wrong : the schemas are valid and well done ( Xml-Spy ).

The problem seems to be that Common.xsd appears twice: one time in
Resident.xsd and an other time in Person.xsd. i tried to put Common.xsd &
Common-Naming.xsd in a same file it doesn't change anything.

Thank for any help because i'm currently freezed in my dev....

<!-- COMMON.XSD -->
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified" attributeFormDefault="unqualified"
id="CommonSpace">
<xs:group name="IEntity">
<xs:sequence>
<xs:element name="Reference" type="xs:string"/>
</xs:sequence>
</xs:group>
<xs:complexType name="BusinessEntityType">
<xs:sequence>
<xs:group ref="IEntity"/>
</xs:sequence>
<xs:attributeGroup ref="ISqlEntity"/>
</xs:complexType>
<xs:complexType name="EntityRefType">
<xs:sequence>
<xs:element name="Reference" type="xs:string"/>
<xs:element name="Description" type="xs:string"/>
</xs:sequence>
<xs:attributeGroup ref="ISqlEntity"/>
</xs:complexType>
<xs:complexType name="RefType">
<xs:complexContent>
<xs:extension base="EntityRefType">
<xs:attribute name="type" type="xs:string"/>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:attributeGroup name="ISqlEntity">
<xs:attribute name="oid" type="xs:string"/>
</xs:attributeGroup>
</xs:schema>
<!-- COMMON-NAMING.XSD -->
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified" attributeFormDefault="unqualified"
id="CommonNamingSpace">
<xs:include schemaLocation="Common.xsd" />
<xs:simpleType name="SexeTypology">
<xs:restriction base="xs:string">
<xs:enumeration value="M" />
<xs:enumeration value="F" />
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="CivilityTypology">
<xs:restriction base="xs:string">
<xs:enumeration value="c1:MRS" />
<xs:enumeration value="c2:MISS" />
<xs:enumeration value="c3:MR" />
<xs:enumeration value="c4:DOC" />
<xs:enumeration value="c5:PROF" />
</xs:restriction>
</xs:simpleType>
<xs:complexType name="CivilityType">
<xs:simpleContent>
<xs:extension base="xs:string">
<xs:attribute name="type" type="CivilityTypology"
default="c3:MR" />
</xs:extension>
</xs:simpleContent>
</xs:complexType>
<xs:complexType name="NameType">
<xs:sequence>
<xs:element name="Civility" type="CivilityType" />
<xs:element name="First" type="xs:string" />
<xs:element name="Last" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:schema>
<!-- PERSON.XSD -->
<xs:schema xmlns="http://copro/Copro.Persons"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://copro/Copro.Persons"

elementFormDefault="qualified"
attributeFormDefault="unqualified" id="PersonSpace">
<xs:include schemaLocation="Common-Naming.xsd" />
<xs:simpleType name="FamillyStatus">
<xs:restriction base="xs:string">
<xs:enumeration value="SINGLE" />
<xs:enumeration value="MARIED" />
<xs:enumeration value="WEADOW" />
<xs:enumeration value="UNDEFINED" />
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="CommonSharedActivity">
<xs:restriction base="xs:string">
<xs:enumeration value="Jardinage" />
<xs:enumeration value="Musique" />
<xs:enumeration value="Informatique" />
<xs:enumeration value="Baby-Sisting" />
</xs:restriction>
</xs:simpleType>
<xs:complexType name="PersonType">
<xs:complexContent>
<xs:extension base="BusinessEntityType">
<xs:sequence>
<xs:element name="Name" type="NameType" />
<xs:element name="ArrivalDate" type="xs:date"
minOccurs="0" />
<xs:element name="IsCoproManager" type="xs:boolean"
default="false" minOccurs="0" />
<xs:element name="FamillyStatus" type="FamillyStatus"
default="UNDEFINED" minOccurs="0" />
<xs:element name="BirthDay" type="xs:dateTime"
minOccurs="0" />
<xs:element name="Email" type="xs:string"

minOccurs="0" />
<xs:element name="SharedActivity" type="xs:string"
minOccurs="0" maxOccurs="unbounded" />
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:complexType name="PersonRefType">
<xs:complexContent>
<xs:extension base="EntityRefType">
<xs:sequence>
<xs:element ref="Person" minOccurs="0" />
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:element name="Person" type="PersonType">
<xs:unique name="PersonByReference">
<xs:selector xpath="." />
<xs:field xpath="Reference" />
</xs:unique>
</xs:element>
</xs:schema>
<!-- RESIDENT.XSD -->
<xs:schema xmlns="http://copro/Copro.Residents"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:p="http://copro/Copro.Persons"
targetNamespace="http://copro/Copro.Residents"

elementFormDefault="qualified"
attributeFormDefault="unqualified" id="ResidentSpace">
<xs:include schemaLocation="Common.xsd"/>
<xs:import namespace="http://copro/Copro.Persons"
schemaLocation="Person.xsd"/>
<xs:complexType name="ResidentType">
<xs:complexContent>
<xs:extension base="BusinessEntityType">
<xs:sequence>
<xs:element name="Copro-Item" type="RefType" maxOccurs="unbounded"/>
<xs:element name="Person" type="p:PersonRefType" maxOccurs="unbounded"/>
<!--
<xs:element ref="p:Person" maxOccurs="unbounded"/>
-->
</xs:sequence>
<xs:attribute name="copro" type="xs:string"/>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:element name="Resident" type="ResidentType"/>
</xs:schema>


Nov 12 '05 #3

P: n/a
Could you please share your code, so I could try it and let you know.
Thanks.
"Brice Prunier" <Br**********@discussions.microsoft.com> wrote in message
news:2B**********************************@microsof t.com...
Hello,

Just for info i run the program again : here is the console output :

Current dir: D:\Projects\Copro\Copro.Schemas\bin\Debug
Current dir: D:\Projects\Copro\Copro.Schemas
loading: Resident.xsd
loaded: Resident.xsd
loaded schemas : 2
System.Xml.Schema.XmlSchemaException: The attribute 'oid' already exists.
System.Exception: Compile error ---> System.Xml.Schema.XmlSchemaException:
The attribute 'oid' already exists.
--- End of inner exception stack trace ---
at Schema.Program.schemaSet_ValidationEventHandler(Ob ject sender,
ValidationEventArgs e) in D:\Projects\Copro\Copro.Schemas\Program.cs:line 58 at System.Xml.Schema.BaseProcessor.SendValidationEven t(XmlSchemaException e, XmlSeverityType severity)
at System.Xml.Schema.Compiler.CompileLocalAttributes( XmlSchemaComplexType baseType, XmlSchemaComplexType derivedType, XmlSchemaObjectCollection
attributes, XmlSchemaAnyAttribute anyAttribute, XmlSchemaDerivationMethod
derivedBy)
at System.Xml.Schema.Compiler.CompileComplexType(XmlS chemaComplexType
complexType)
at System.Xml.Schema.Compiler.Compile()
at System.Xml.Schema.Compiler.Execute(XmlSchemaSet schemaSet, Boolean
compileContentModel, SchemaInfo schemaCompiledInfo)
at System.Xml.Schema.XmlSchemaSet.Compile()
at Schema.Program.Main(String[] args) in
D:\Projects\Copro\Copro.Schemas\Program.cs:line 40
Compile failed...

regards

"Zafar Abbas" wrote:
I am able to save all 4 files as XSD schemas, and compile Residents.xsd
using the XmlSchemaSet without any problems.
What version of the .net framework are you using and how does your code look like?

Thanks.
"Brice Prunier" <Br**********@discussions.microsoft.com> wrote in message news:1B**********************************@microsof t.com...
Here under 4 schemas i'm working with ( it may be long: sorry...)
The context is the following :
Resident.xsd imports Person.xsd and includes Common.xsd ( anonimous

schema:
no TargetNamespace )
Person.xsd includes Common-Naming.xsd ( anonimous schemas )
Common-Naming.xsd includes common.xsd ( both are anonimous schemas )

Compilation of Resident.xsd raise the following exception:
"System.Xml.Schema.XmlSchemaException: The attribute 'oid' already
exists...."

That is wrong : the schemas are valid and well done ( Xml-Spy ).

The problem seems to be that Common.xsd appears twice: one time in
Resident.xsd and an other time in Person.xsd. i tried to put Common.xsd & Common-Naming.xsd in a same file it doesn't change anything.

Thank for any help because i'm currently freezed in my dev....

<!-- COMMON.XSD -->
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified" attributeFormDefault="unqualified"
id="CommonSpace">
<xs:group name="IEntity">
<xs:sequence>
<xs:element name="Reference" type="xs:string"/>
</xs:sequence>
</xs:group>
<xs:complexType name="BusinessEntityType">
<xs:sequence>
<xs:group ref="IEntity"/>
</xs:sequence>
<xs:attributeGroup ref="ISqlEntity"/>
</xs:complexType>
<xs:complexType name="EntityRefType">
<xs:sequence>
<xs:element name="Reference" type="xs:string"/>
<xs:element name="Description" type="xs:string"/>
</xs:sequence>
<xs:attributeGroup ref="ISqlEntity"/>
</xs:complexType>
<xs:complexType name="RefType">
<xs:complexContent>
<xs:extension base="EntityRefType">
<xs:attribute name="type" type="xs:string"/>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:attributeGroup name="ISqlEntity">
<xs:attribute name="oid" type="xs:string"/>
</xs:attributeGroup>
</xs:schema>
<!-- COMMON-NAMING.XSD -->
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified" attributeFormDefault="unqualified"
id="CommonNamingSpace">
<xs:include schemaLocation="Common.xsd" />
<xs:simpleType name="SexeTypology">
<xs:restriction base="xs:string">
<xs:enumeration value="M" />
<xs:enumeration value="F" />
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="CivilityTypology">
<xs:restriction base="xs:string">
<xs:enumeration value="c1:MRS" />
<xs:enumeration value="c2:MISS" />
<xs:enumeration value="c3:MR" />
<xs:enumeration value="c4:DOC" />
<xs:enumeration value="c5:PROF" />
</xs:restriction>
</xs:simpleType>
<xs:complexType name="CivilityType">
<xs:simpleContent>
<xs:extension base="xs:string">
<xs:attribute name="type" type="CivilityTypology"
default="c3:MR" />
</xs:extension>
</xs:simpleContent>
</xs:complexType>
<xs:complexType name="NameType">
<xs:sequence>
<xs:element name="Civility" type="CivilityType" />
<xs:element name="First" type="xs:string" />
<xs:element name="Last" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:schema>
<!-- PERSON.XSD -->
<xs:schema xmlns="http://copro/Copro.Persons"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://copro/Copro.Persons"

elementFormDefault="qualified"
attributeFormDefault="unqualified" id="PersonSpace">
<xs:include schemaLocation="Common-Naming.xsd" />
<xs:simpleType name="FamillyStatus">
<xs:restriction base="xs:string">
<xs:enumeration value="SINGLE" />
<xs:enumeration value="MARIED" />
<xs:enumeration value="WEADOW" />
<xs:enumeration value="UNDEFINED" />
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="CommonSharedActivity">
<xs:restriction base="xs:string">
<xs:enumeration value="Jardinage" />
<xs:enumeration value="Musique" />
<xs:enumeration value="Informatique" />
<xs:enumeration value="Baby-Sisting" />
</xs:restriction>
</xs:simpleType>
<xs:complexType name="PersonType">
<xs:complexContent>
<xs:extension base="BusinessEntityType">
<xs:sequence>
<xs:element name="Name" type="NameType" />
<xs:element name="ArrivalDate" type="xs:date"
minOccurs="0" />
<xs:element name="IsCoproManager" type="xs:boolean" default="false" minOccurs="0" />
<xs:element name="FamillyStatus" type="FamillyStatus" default="UNDEFINED" minOccurs="0" />
<xs:element name="BirthDay" type="xs:dateTime"
minOccurs="0" />
<xs:element name="Email" type="xs:string"

minOccurs="0" />
<xs:element name="SharedActivity" type="xs:string"
minOccurs="0" maxOccurs="unbounded" />
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:complexType name="PersonRefType">
<xs:complexContent>
<xs:extension base="EntityRefType">
<xs:sequence>
<xs:element ref="Person" minOccurs="0" />
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:element name="Person" type="PersonType">
<xs:unique name="PersonByReference">
<xs:selector xpath="." />
<xs:field xpath="Reference" />
</xs:unique>
</xs:element>
</xs:schema>
<!-- RESIDENT.XSD -->
<xs:schema xmlns="http://copro/Copro.Residents"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:p="http://copro/Copro.Persons"
targetNamespace="http://copro/Copro.Residents"

elementFormDefault="qualified"
attributeFormDefault="unqualified" id="ResidentSpace">
<xs:include schemaLocation="Common.xsd"/>
<xs:import namespace="http://copro/Copro.Persons"
schemaLocation="Person.xsd"/>
<xs:complexType name="ResidentType">
<xs:complexContent>
<xs:extension base="BusinessEntityType">
<xs:sequence>
<xs:element name="Copro-Item" type="RefType" maxOccurs="unbounded"/>
<xs:element name="Person" type="p:PersonRefType" maxOccurs="unbounded"/> <!--
<xs:element ref="p:Person" maxOccurs="unbounded"/>
-->
</xs:sequence>
<xs:attribute name="copro" type="xs:string"/>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:element name="Resident" type="ResidentType"/>
</xs:schema>


Nov 12 '05 #4

P: n/a
I would have send a zip if it was possible but i don't kown how to do it on a
thread.
( i guess it's not possible.. ) so here is my little console program.

As i put all my XML-Schemas in the Console Project i reset the working "dir"
first, otherwise you can't do more simple...

Thanks again for your help.

using System.Xml.Serialization;

namespace Schema
{
class Program
{
private const string shemaName = @"Resident.xsd";

[STAThread]
static void Main( string[] args )
{
string currentDir = Directory.GetCurrentDirectory();
Console.WriteLine( "Current dir: {0}",
currentDir );
string path = Path.Combine( currentDir,
@"..\.." );
Directory.SetCurrentDirectory( path);
currentDir = Directory.GetCurrentDirectory();
Console.WriteLine( "Current dir: {0}",
currentDir );
path = Path.Combine( currentDir, shemaName );
XmlSchema schema = null;
Console.WriteLine( "loading: " + shemaName );
using ( Stream stream = new FileStream( path,
FileMode.Open, FileAccess.Read, FileShare.Read ) )
{
XmlReader xr = new XmlTextReader(
stream );
schema =
System.Xml.Schema.XmlSchema.Read( xr, null );
}
Console.WriteLine( "loaded: " + shemaName );
XmlSchemaSet schemaSet = new XmlSchemaSet();
schemaSet.Add( schema );
Console.WriteLine( "loaded schemas : " +
schemaSet.Count );

try
{

schemaSet.ValidationEventHandler+=new ValidationEventHandler(
schemaSet_ValidationEventHandler );
schemaSet.Compile();
}
catch(Exception e )
{
Console.WriteLine( e.ToString());
}

if( schemaSet.IsCompiled )
Console.WriteLine( "Compile done..." );
else
Console.WriteLine( "Compile failed..." );

Console.Read();
}

static void schemaSet_ValidationEventHandler( object
sender, ValidationEventArgs e )
{
Console.WriteLine( e.Exception.ToString() );
throw new Exception( "Compile error",
e.Exception );
}
}
}
"Zafar Abbas" wrote:
Could you please share your code, so I could try it and let you know.
Thanks.
"Brice Prunier" <Br**********@discussions.microsoft.com> wrote in message
news:2B**********************************@microsof t.com...
Hello,

Just for info i run the program again : here is the console output :

Current dir: D:\Projects\Copro\Copro.Schemas\bin\Debug
Current dir: D:\Projects\Copro\Copro.Schemas
loading: Resident.xsd
loaded: Resident.xsd
loaded schemas : 2
System.Xml.Schema.XmlSchemaException: The attribute 'oid' already exists.
System.Exception: Compile error ---> System.Xml.Schema.XmlSchemaException:
The attribute 'oid' already exists.
--- End of inner exception stack trace ---
at Schema.Program.schemaSet_ValidationEventHandler(Ob ject sender,
ValidationEventArgs e) in D:\Projects\Copro\Copro.Schemas\Program.cs:line

58
at

System.Xml.Schema.BaseProcessor.SendValidationEven t(XmlSchemaException
e, XmlSeverityType severity)
at

System.Xml.Schema.Compiler.CompileLocalAttributes( XmlSchemaComplexType
baseType, XmlSchemaComplexType derivedType, XmlSchemaObjectCollection
attributes, XmlSchemaAnyAttribute anyAttribute, XmlSchemaDerivationMethod
derivedBy)
at System.Xml.Schema.Compiler.CompileComplexType(XmlS chemaComplexType
complexType)
at System.Xml.Schema.Compiler.Compile()
at System.Xml.Schema.Compiler.Execute(XmlSchemaSet schemaSet, Boolean
compileContentModel, SchemaInfo schemaCompiledInfo)
at System.Xml.Schema.XmlSchemaSet.Compile()
at Schema.Program.Main(String[] args) in
D:\Projects\Copro\Copro.Schemas\Program.cs:line 40
Compile failed...

regards

"Zafar Abbas" wrote:
I am able to save all 4 files as XSD schemas, and compile Residents.xsd
using the XmlSchemaSet without any problems.
What version of the .net framework are you using and how does your code look like?

Thanks.
"Brice Prunier" <Br**********@discussions.microsoft.com> wrote in message news:1B**********************************@microsof t.com...
> Here under 4 schemas i'm working with ( it may be long: sorry...)
> The context is the following :
> Resident.xsd imports Person.xsd and includes Common.xsd ( anonimous
schema:
> no TargetNamespace )
> Person.xsd includes Common-Naming.xsd ( anonimous schemas )
> Common-Naming.xsd includes common.xsd ( both are anonimous schemas )
>
> Compilation of Resident.xsd raise the following exception:
> "System.Xml.Schema.XmlSchemaException: The attribute 'oid' already
> exists...."
>
> That is wrong : the schemas are valid and well done ( Xml-Spy ).
>
> The problem seems to be that Common.xsd appears twice: one time in
> Resident.xsd and an other time in Person.xsd. i tried to put Common.xsd & > Common-Naming.xsd in a same file it doesn't change anything.
>
> Thank for any help because i'm currently freezed in my dev....
>
> <!-- COMMON.XSD -->
> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
> elementFormDefault="qualified" attributeFormDefault="unqualified"
> id="CommonSpace">
> <xs:group name="IEntity">
> <xs:sequence>
> <xs:element name="Reference" type="xs:string"/>
> </xs:sequence>
> </xs:group>
> <xs:complexType name="BusinessEntityType">
> <xs:sequence>
> <xs:group ref="IEntity"/>
> </xs:sequence>
> <xs:attributeGroup ref="ISqlEntity"/>
> </xs:complexType>
> <xs:complexType name="EntityRefType">
> <xs:sequence>
> <xs:element name="Reference" type="xs:string"/>
> <xs:element name="Description" type="xs:string"/>
> </xs:sequence>
> <xs:attributeGroup ref="ISqlEntity"/>
> </xs:complexType>
> <xs:complexType name="RefType">
> <xs:complexContent>
> <xs:extension base="EntityRefType">
> <xs:attribute name="type" type="xs:string"/>
> </xs:extension>
> </xs:complexContent>
> </xs:complexType>
> <xs:attributeGroup name="ISqlEntity">
> <xs:attribute name="oid" type="xs:string"/>
> </xs:attributeGroup>
> </xs:schema>
> <!-- COMMON-NAMING.XSD -->
> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
> elementFormDefault="qualified" attributeFormDefault="unqualified"
> id="CommonNamingSpace">
> <xs:include schemaLocation="Common.xsd" />
> <xs:simpleType name="SexeTypology">
> <xs:restriction base="xs:string">
> <xs:enumeration value="M" />
> <xs:enumeration value="F" />
> </xs:restriction>
> </xs:simpleType>
> <xs:simpleType name="CivilityTypology">
> <xs:restriction base="xs:string">
> <xs:enumeration value="c1:MRS" />
> <xs:enumeration value="c2:MISS" />
> <xs:enumeration value="c3:MR" />
> <xs:enumeration value="c4:DOC" />
> <xs:enumeration value="c5:PROF" />
> </xs:restriction>
> </xs:simpleType>
> <xs:complexType name="CivilityType">
> <xs:simpleContent>
> <xs:extension base="xs:string">
> <xs:attribute name="type" type="CivilityTypology"
> default="c3:MR" />
> </xs:extension>
> </xs:simpleContent>
> </xs:complexType>
> <xs:complexType name="NameType">
> <xs:sequence>
> <xs:element name="Civility" type="CivilityType" />
> <xs:element name="First" type="xs:string" />
> <xs:element name="Last" type="xs:string" />
> </xs:sequence>
> </xs:complexType>
> </xs:schema>
> <!-- PERSON.XSD -->
> <xs:schema xmlns="http://copro/Copro.Persons"
> xmlns:xs="http://www.w3.org/2001/XMLSchema"
> targetNamespace="http://copro/Copro.Persons"
elementFormDefault="qualified"
> attributeFormDefault="unqualified" id="PersonSpace">
> <xs:include schemaLocation="Common-Naming.xsd" />
> <xs:simpleType name="FamillyStatus">
> <xs:restriction base="xs:string">
> <xs:enumeration value="SINGLE" />
> <xs:enumeration value="MARIED" />
> <xs:enumeration value="WEADOW" />
> <xs:enumeration value="UNDEFINED" />
> </xs:restriction>
> </xs:simpleType>
> <xs:simpleType name="CommonSharedActivity">
> <xs:restriction base="xs:string">
> <xs:enumeration value="Jardinage" />
> <xs:enumeration value="Musique" />
> <xs:enumeration value="Informatique" />
> <xs:enumeration value="Baby-Sisting" />
> </xs:restriction>
> </xs:simpleType>
> <xs:complexType name="PersonType">
> <xs:complexContent>
> <xs:extension base="BusinessEntityType">
> <xs:sequence>
> <xs:element name="Name" type="NameType" />
> <xs:element name="ArrivalDate" type="xs:date"
> minOccurs="0" />
> <xs:element name="IsCoproManager" type="xs:boolean" > default="false" minOccurs="0" />
> <xs:element name="FamillyStatus" type="FamillyStatus" > default="UNDEFINED" minOccurs="0" />
> <xs:element name="BirthDay" type="xs:dateTime"
> minOccurs="0" />
> <xs:element name="Email" type="xs:string"
minOccurs="0" />
> <xs:element name="SharedActivity" type="xs:string"
> minOccurs="0" maxOccurs="unbounded" />
> </xs:sequence>
> </xs:extension>
> </xs:complexContent>
> </xs:complexType>
> <xs:complexType name="PersonRefType">
> <xs:complexContent>
> <xs:extension base="EntityRefType">
> <xs:sequence>
> <xs:element ref="Person" minOccurs="0" />
> </xs:sequence>
> </xs:extension>
> </xs:complexContent>
> </xs:complexType>
> <xs:element name="Person" type="PersonType">
> <xs:unique name="PersonByReference">
> <xs:selector xpath="." />
> <xs:field xpath="Reference" />
> </xs:unique>
> </xs:element>
> </xs:schema>
> <!-- RESIDENT.XSD -->
> <xs:schema xmlns="http://copro/Copro.Residents"
> xmlns:xs="http://www.w3.org/2001/XMLSchema"
> xmlns:p="http://copro/Copro.Persons"
> targetNamespace="http://copro/Copro.Residents"
elementFormDefault="qualified"
> attributeFormDefault="unqualified" id="ResidentSpace">
> <xs:include schemaLocation="Common.xsd"/>
> <xs:import namespace="http://copro/Copro.Persons"
> schemaLocation="Person.xsd"/>
> <xs:complexType name="ResidentType">
> <xs:complexContent>
> <xs:extension base="BusinessEntityType">
> <xs:sequence>
> <xs:element name="Copro-Item" type="RefType" maxOccurs="unbounded"/>
> <xs:element name="Person" type="p:PersonRefType" maxOccurs="unbounded"/> > <!--
> <xs:element ref="p:Person" maxOccurs="unbounded"/>
> -->
> </xs:sequence>
> <xs:attribute name="copro" type="xs:string"/>
> </xs:extension>
> </xs:complexContent>
> </xs:complexType>
> <xs:element name="Resident" type="ResidentType"/>
> </xs:schema>
>
>


Nov 12 '05 #5

P: n/a
I had to tweak the path information in your program to make it work locally
but when I ran it, it did not produce any error, Here was the output:

Current dir: C:\tempTest\temp
Current dir: C:\tempTest\temp
loading: Resident.xsd
loaded: Resident.xsd
loaded schemas : 2
Compile done...

I am using later bits of the .net framework than you are using, and this
does not seem to be a problem anymore.

Thanks.
"Brice Prunier" <Br**********@discussions.microsoft.com> wrote in message
news:84**********************************@microsof t.com...
I would have send a zip if it was possible but i don't kown how to do it on a thread.
( i guess it's not possible.. ) so here is my little console program.

As i put all my XML-Schemas in the Console Project i reset the working "dir" first, otherwise you can't do more simple...

Thanks again for your help.

using System.Xml.Serialization;

namespace Schema
{
class Program
{
private const string shemaName = @"Resident.xsd";

[STAThread]
static void Main( string[] args )
{
string currentDir = Directory.GetCurrentDirectory();
Console.WriteLine( "Current dir: {0}",
currentDir );
string path = Path.Combine( currentDir,
@"..\.." );
Directory.SetCurrentDirectory( path);
currentDir = Directory.GetCurrentDirectory(); Console.WriteLine( "Current dir: {0}",
currentDir );
path = Path.Combine( currentDir, shemaName ); XmlSchema schema = null;
Console.WriteLine( "loading: " + shemaName ); using ( Stream stream = new FileStream( path, FileMode.Open, FileAccess.Read, FileShare.Read ) )
{
XmlReader xr = new XmlTextReader(
stream );
schema =
System.Xml.Schema.XmlSchema.Read( xr, null );
}
Console.WriteLine( "loaded: " + shemaName );
XmlSchemaSet schemaSet = new XmlSchemaSet();
schemaSet.Add( schema );
Console.WriteLine( "loaded schemas : " +
schemaSet.Count );

try
{

schemaSet.ValidationEventHandler+=new ValidationEventHandler(
schemaSet_ValidationEventHandler );
schemaSet.Compile();
}
catch(Exception e )
{
Console.WriteLine( e.ToString());
}

if( schemaSet.IsCompiled )
Console.WriteLine( "Compile done..." );
else
Console.WriteLine( "Compile failed..." );

Console.Read();
}

static void schemaSet_ValidationEventHandler( object
sender, ValidationEventArgs e )
{
Console.WriteLine( e.Exception.ToString() );
throw new Exception( "Compile error",
e.Exception );
}
}
}
"Zafar Abbas" wrote:
Could you please share your code, so I could try it and let you know.
Thanks.
"Brice Prunier" <Br**********@discussions.microsoft.com> wrote in message news:2B**********************************@microsof t.com...
Hello,

Just for info i run the program again : here is the console output :

Current dir: D:\Projects\Copro\Copro.Schemas\bin\Debug
Current dir: D:\Projects\Copro\Copro.Schemas
loading: Resident.xsd
loaded: Resident.xsd
loaded schemas : 2
System.Xml.Schema.XmlSchemaException: The attribute 'oid' already exists. System.Exception: Compile error ---> System.Xml.Schema.XmlSchemaException: The attribute 'oid' already exists.
--- End of inner exception stack trace ---
at Schema.Program.schemaSet_ValidationEventHandler(Ob ject sender,
ValidationEventArgs e) in D:\Projects\Copro\Copro.Schemas\Program.cs:line
58
at

System.Xml.Schema.BaseProcessor.SendValidationEven t(XmlSchemaException
e, XmlSeverityType severity)
at

System.Xml.Schema.Compiler.CompileLocalAttributes( XmlSchemaComplexType
baseType, XmlSchemaComplexType derivedType, XmlSchemaObjectCollection
attributes, XmlSchemaAnyAttribute anyAttribute,
XmlSchemaDerivationMethod derivedBy)
at System.Xml.Schema.Compiler.CompileComplexType(XmlS chemaComplexType complexType)
at System.Xml.Schema.Compiler.Compile()
at System.Xml.Schema.Compiler.Execute(XmlSchemaSet schemaSet, Boolean compileContentModel, SchemaInfo schemaCompiledInfo)
at System.Xml.Schema.XmlSchemaSet.Compile()
at Schema.Program.Main(String[] args) in
D:\Projects\Copro\Copro.Schemas\Program.cs:line 40
Compile failed...

regards

"Zafar Abbas" wrote:

> I am able to save all 4 files as XSD schemas, and compile Residents.xsd > using the XmlSchemaSet without any problems.
> What version of the .net framework are you using and how does your code look
> like?
>
> Thanks.
>
>
> "Brice Prunier" <Br**********@discussions.microsoft.com> wrote in

message
> news:1B**********************************@microsof t.com...
> > Here under 4 schemas i'm working with ( it may be long: sorry...)
> > The context is the following :
> > Resident.xsd imports Person.xsd and includes Common.xsd (

anonimous > schema:
> > no TargetNamespace )
> > Person.xsd includes Common-Naming.xsd ( anonimous schemas )
> > Common-Naming.xsd includes common.xsd ( both are anonimous schemas ) > >
> > Compilation of Resident.xsd raise the following exception:
> > "System.Xml.Schema.XmlSchemaException: The attribute 'oid' already > > exists...."
> >
> > That is wrong : the schemas are valid and well done ( Xml-Spy ).
> >
> > The problem seems to be that Common.xsd appears twice: one time in
> > Resident.xsd and an other time in Person.xsd. i tried to put

Common.xsd &
> > Common-Naming.xsd in a same file it doesn't change anything.
> >
> > Thank for any help because i'm currently freezed in my dev....
> >
> > <!-- COMMON.XSD -->
> > <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
> > elementFormDefault="qualified" attributeFormDefault="unqualified"
> > id="CommonSpace">
> > <xs:group name="IEntity">
> > <xs:sequence>
> > <xs:element name="Reference" type="xs:string"/>
> > </xs:sequence>
> > </xs:group>
> > <xs:complexType name="BusinessEntityType">
> > <xs:sequence>
> > <xs:group ref="IEntity"/>
> > </xs:sequence>
> > <xs:attributeGroup ref="ISqlEntity"/>
> > </xs:complexType>
> > <xs:complexType name="EntityRefType">
> > <xs:sequence>
> > <xs:element name="Reference" type="xs:string"/>
> > <xs:element name="Description" type="xs:string"/>
> > </xs:sequence>
> > <xs:attributeGroup ref="ISqlEntity"/>
> > </xs:complexType>
> > <xs:complexType name="RefType">
> > <xs:complexContent>
> > <xs:extension base="EntityRefType">
> > <xs:attribute name="type" type="xs:string"/>
> > </xs:extension>
> > </xs:complexContent>
> > </xs:complexType>
> > <xs:attributeGroup name="ISqlEntity">
> > <xs:attribute name="oid" type="xs:string"/>
> > </xs:attributeGroup>
> > </xs:schema>
> > <!-- COMMON-NAMING.XSD -->
> > <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
> > elementFormDefault="qualified" attributeFormDefault="unqualified"
> > id="CommonNamingSpace">
> > <xs:include schemaLocation="Common.xsd" />
> > <xs:simpleType name="SexeTypology">
> > <xs:restriction base="xs:string">
> > <xs:enumeration value="M" />
> > <xs:enumeration value="F" />
> > </xs:restriction>
> > </xs:simpleType>
> > <xs:simpleType name="CivilityTypology">
> > <xs:restriction base="xs:string">
> > <xs:enumeration value="c1:MRS" />
> > <xs:enumeration value="c2:MISS" />
> > <xs:enumeration value="c3:MR" />
> > <xs:enumeration value="c4:DOC" />
> > <xs:enumeration value="c5:PROF" />
> > </xs:restriction>
> > </xs:simpleType>
> > <xs:complexType name="CivilityType">
> > <xs:simpleContent>
> > <xs:extension base="xs:string">
> > <xs:attribute name="type" type="CivilityTypology"
> > default="c3:MR" />
> > </xs:extension>
> > </xs:simpleContent>
> > </xs:complexType>
> > <xs:complexType name="NameType">
> > <xs:sequence>
> > <xs:element name="Civility" type="CivilityType" />
> > <xs:element name="First" type="xs:string" />
> > <xs:element name="Last" type="xs:string" />
> > </xs:sequence>
> > </xs:complexType>
> > </xs:schema>
> > <!-- PERSON.XSD -->
> > <xs:schema xmlns="http://copro/Copro.Persons"
> > xmlns:xs="http://www.w3.org/2001/XMLSchema"
> > targetNamespace="http://copro/Copro.Persons"
> elementFormDefault="qualified"
> > attributeFormDefault="unqualified" id="PersonSpace">
> > <xs:include schemaLocation="Common-Naming.xsd" />
> > <xs:simpleType name="FamillyStatus">
> > <xs:restriction base="xs:string">
> > <xs:enumeration value="SINGLE" />
> > <xs:enumeration value="MARIED" />
> > <xs:enumeration value="WEADOW" />
> > <xs:enumeration value="UNDEFINED" />
> > </xs:restriction>
> > </xs:simpleType>
> > <xs:simpleType name="CommonSharedActivity">
> > <xs:restriction base="xs:string">
> > <xs:enumeration value="Jardinage" />
> > <xs:enumeration value="Musique" />
> > <xs:enumeration value="Informatique" />
> > <xs:enumeration value="Baby-Sisting" />
> > </xs:restriction>
> > </xs:simpleType>
> > <xs:complexType name="PersonType">
> > <xs:complexContent>
> > <xs:extension base="BusinessEntityType">
> > <xs:sequence>
> > <xs:element name="Name" type="NameType" />
> > <xs:element name="ArrivalDate" type="xs:date"
> > minOccurs="0" />
> > <xs:element name="IsCoproManager"

type="xs:boolean"
> > default="false" minOccurs="0" />
> > <xs:element name="FamillyStatus"

type="FamillyStatus"
> > default="UNDEFINED" minOccurs="0" />
> > <xs:element name="BirthDay" type="xs:dateTime"
> > minOccurs="0" />
> > <xs:element name="Email" type="xs:string"
> minOccurs="0" />
> > <xs:element name="SharedActivity" type="xs:string" > > minOccurs="0" maxOccurs="unbounded" />
> > </xs:sequence>
> > </xs:extension>
> > </xs:complexContent>
> > </xs:complexType>
> > <xs:complexType name="PersonRefType">
> > <xs:complexContent>
> > <xs:extension base="EntityRefType">
> > <xs:sequence>
> > <xs:element ref="Person" minOccurs="0" />
> > </xs:sequence>
> > </xs:extension>
> > </xs:complexContent>
> > </xs:complexType>
> > <xs:element name="Person" type="PersonType">
> > <xs:unique name="PersonByReference">
> > <xs:selector xpath="." />
> > <xs:field xpath="Reference" />
> > </xs:unique>
> > </xs:element>
> > </xs:schema>
> > <!-- RESIDENT.XSD -->
> > <xs:schema xmlns="http://copro/Copro.Residents"
> > xmlns:xs="http://www.w3.org/2001/XMLSchema"
> > xmlns:p="http://copro/Copro.Persons"
> > targetNamespace="http://copro/Copro.Residents"
> elementFormDefault="qualified"
> > attributeFormDefault="unqualified" id="ResidentSpace">
> > <xs:include schemaLocation="Common.xsd"/>
> > <xs:import namespace="http://copro/Copro.Persons"
> > schemaLocation="Person.xsd"/>
> > <xs:complexType name="ResidentType">
> > <xs:complexContent>
> > <xs:extension base="BusinessEntityType">
> > <xs:sequence>
> > <xs:element name="Copro-Item" type="RefType" maxOccurs="unbounded"/> > > <xs:element name="Person" type="p:PersonRefType"

maxOccurs="unbounded"/>
> > <!--
> > <xs:element ref="p:Person" maxOccurs="unbounded"/>
> > -->
> > </xs:sequence>
> > <xs:attribute name="copro" type="xs:string"/>
> > </xs:extension>
> > </xs:complexContent>
> > </xs:complexType>
> > <xs:element name="Resident" type="ResidentType"/>
> > </xs:schema>
> >
> >
>
>
>


Nov 12 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.