472,791 Members | 1,434 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,791 software developers and data experts.

XmlSchemaSet Compile error ?

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
5 3707
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
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Carmine Cairo | last post by:
Hi, I'm working on a project and today I've note a little problem during the compile fase. Here a little piece of code: // 1st version welldone = 0; size = p->getSize(); backbone = new...
10
by: Chris LaJoie | last post by:
Our company has been developing a program in C# for some time now, and we haven't had any problems with it, but just last night something cropped up that has me, and everyone else, stumped. I...
6
by: Thomas Connolly | last post by:
I have 2 pages referencing the same codebehind file in my project. Originally the pages referenced separate code behind files. Once I changed the reference to the same file, everything worked...
3
by: sachinvyas | last post by:
Hi, I have following schema saved in new.xsd <?xml version="1.0" encoding="utf-8"?> <xs:schema targetNamespace="http://www.smpte-ra.org/schemas/429.7/2006/CPL"...
9
by: ThunderMusic | last post by:
Hi, I'd like to create a compile time error in my class... maybe there's a way already built in in the framework so I can achieve what I want... I have 2 constructors in my class. One of them...
4
by: tony | last post by:
Hello! My question is about calling this method CollectData below but I get a compile error that I shouldn't have because the type parameter is correct. The compile error is the following:...
1
by: =?Utf-8?B?Q2hyaXN0b3BoZXI=?= | last post by:
Hello, Using .NET 2.0 and the System.XML.Schema.XMLSchema class. I am adding some schemas into the XMLSchemaSet object using XmlSchemaSet.Add. The schemas I am adding have circular imports, and...
1
by: Ryan | last post by:
Hello Xml Gurus, I'm trying to build an XML schema in memory using the System.Xml.XmlSchema namespace objects, validate it, and then write it to a file. The problem I'm facing is that...
2
by: BruceWho | last post by:
I downloaded boost1.35.0 and built it with following command: bjam --toolset=msvc-7.1 --variant=release --threading=multi -- link=shared --with-system stage and it failed to compile, error...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 2 August 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: erikbower65 | last post by:
Using CodiumAI's pr-agent is simple and powerful. Follow these steps: 1. Install CodiumAI CLI: Ensure Node.js is installed, then run 'npm install -g codiumai' in the terminal. 2. Connect to...
0
linyimin
by: linyimin | last post by:
Spring Startup Analyzer generates an interactive Spring application startup report that lets you understand what contributes to the application startup time and helps to optimize it. Support for...
0
by: kcodez | last post by:
As a H5 game development enthusiast, I recently wrote a very interesting little game - Toy Claw ((http://claw.kjeek.com/))。Here I will summarize and share the development experience here, and hope it...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Sept 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
14
DJRhino1175
by: DJRhino1175 | last post by:
When I run this code I get an error, its Run-time error# 424 Object required...This is my first attempt at doing something like this. I test the entire code and it worked until I added this - If...
5
by: DJRhino | last post by:
Private Sub CboDrawingID_BeforeUpdate(Cancel As Integer) If = 310029923 Or 310030138 Or 310030152 Or 310030346 Or 310030348 Or _ 310030356 Or 310030359 Or 310030362 Or...
0
by: lllomh | last post by:
How does React native implement an English player?
0
by: Mushico | last post by:
How to calculate date of retirement from date of birth

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.