R
ryuujin
Hi all,
I have a complex XML schema built by one XSD file importing many
others xsd files. Then, every imported xsd file imports others and so
on.
I'm tryinh to obtain the enumeration of a complex type defined in the
schema. I tried with LINQ, but without success.
If the schema could be one single flatted file, I can obtain what I'm
finding using LINQ to XML.
I tried to convert the multiple schema in a single file... and I was
writing a C# program to accomplish it with a recursive function, but I
couldn't reach any good result but I have only my mind confuse now![Smile :) :)](/styles/default/custom/smilies/smile.gif)
An example of datas I'm trying to extract from the xsd schema is a
list of countries (but there are many other datas I have to extract):
[...]
<xsd:simpleType name="CountryType">
<xsd:annotation>
<xsd:documentation xml:lang="en">
This is the ISO list of countries and their ISO
abbreviations.
The list is an
enumeration and the key is the abbreviation.
</xsd:documentation>
</xsd:annotation>
<xsd:restriction base="xsd:string">
<xsd:enumeration value="AD">
<xsd:annotation>
<xsd:documentation xml:lang="en">Andorra</
xsd:documentation>
</xsd:annotation>
</xsd:enumeration>
<xsd:enumeration value="AE">
<xsd:annotation>
<xsd:documentation xml:lang="en">United Arab
Emirates</xsd:documentation>
</xsd:annotation>
[...]
The schema containing the country is in a XSD file, imported in a Xsd
file imported then in the master file.
Example:
countries.xsd <-- imported by BaseTypes.xsd <--- imported by xxx.xsd
<--- imported by MAIN.xsd
THANKS!!!
Every answers is graceful... source code, link, examples, ....
I have a complex XML schema built by one XSD file importing many
others xsd files. Then, every imported xsd file imports others and so
on.
I'm tryinh to obtain the enumeration of a complex type defined in the
schema. I tried with LINQ, but without success.
If the schema could be one single flatted file, I can obtain what I'm
finding using LINQ to XML.
I tried to convert the multiple schema in a single file... and I was
writing a C# program to accomplish it with a recursive function, but I
couldn't reach any good result but I have only my mind confuse now
![Smile :) :)](/styles/default/custom/smilies/smile.gif)
An example of datas I'm trying to extract from the xsd schema is a
list of countries (but there are many other datas I have to extract):
[...]
<xsd:simpleType name="CountryType">
<xsd:annotation>
<xsd:documentation xml:lang="en">
This is the ISO list of countries and their ISO
abbreviations.
The list is an
enumeration and the key is the abbreviation.
</xsd:documentation>
</xsd:annotation>
<xsd:restriction base="xsd:string">
<xsd:enumeration value="AD">
<xsd:annotation>
<xsd:documentation xml:lang="en">Andorra</
xsd:documentation>
</xsd:annotation>
</xsd:enumeration>
<xsd:enumeration value="AE">
<xsd:annotation>
<xsd:documentation xml:lang="en">United Arab
Emirates</xsd:documentation>
</xsd:annotation>
[...]
The schema containing the country is in a XSD file, imported in a Xsd
file imported then in the master file.
Example:
countries.xsd <-- imported by BaseTypes.xsd <--- imported by xxx.xsd
<--- imported by MAIN.xsd
THANKS!!!
Every answers is graceful... source code, link, examples, ....