473,396 Members | 1,773 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 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 3774
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.