Re: use of XSD

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



Thanks Martin
I'll look into it tomorrow.

Jurjen.

"Martin Honnen" <mahotrash@xxxxxxxx> wrote in message
news:OATFMUG9GHA.3740@xxxxxxxxxxxxxxxxxxxxxxx
Jurjen de Groot wrote:

The type JaNeeType is defined as
<xsd:simpleType name="YesNoType">

<xsd:restriction base="xsd:string">

<xsd:enumeration value="Y Yes" />

<xsd:enumeration value="N No" />

</xsd:restriction>


Is it possible to read the XSD into some kind of xml object and access
the simpleType enumerations to extract the code AND description

.NET 1.x has a schema object model (SOM) implementation with
XmlSchemaCollection
<http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfSystemXmlSchemaXmlSchemaCollectionClassTopic.asp>
and XmlSchema
<http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfSystemXmlSchemaXmlSchemaClassTopic.asp>
so you can indeed load a schema and then have an object model you can
navigate. But with the complexity of possible schema structures the
general navigation is also rather complex. Enumeration is just one
possible facet.
See
<http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconxsdschemaobjectmodelsom.asp>
for details about the SOM.


--

Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/


.



Relevant Pages

  • DataSet.ReadXmlSchema and xs:include
    ... I have tried passing the Schema to a XmlSchemaCollection first. ... This will indeed fire my custom resolver and set up the schema correctly, however there does not appear to be a way to impose this combined schema on the dataset. ... I'm down to performing either a transformation, manual xml munge or even a string replacement to insert the included schema within the parent prior to providing it to the DataSet.ReadXmlSchema method. ...
    (microsoft.public.dotnet.xml)
  • DataSet.ReadXmlSchema and <xs:include/> ... again
    ... I have tried passing the Schema to a XmlSchemaCollection first. ... This will indeed fire my custom resolver and set up the schema correctly, however there does not appear to be a way to impose this combined schema on the dataset. ... I'm down to performing either a transformation, manual xml munge or even a string replacement to insert the included schema within the parent prior to providing it to the DataSet.ReadXmlSchema method. ...
    (microsoft.public.dotnet.xml)
  • problems with loading different xsds with same namespace to XmlSchemaCollection
    ... I am writing an application that uses an extendible XML file. ... extensions XSD's that uses the types in the main XSD as base types. ... the first time I load a Schema into the XmlSchemaCollection it works ... with the most previously schema loaded. ...
    (microsoft.public.dotnet.xml)
  • Type http://microsoft.com/wsdl/types/ is not declared
    ... against the schema generated in the WSDL file (by Visual Studio 2005), ... I am using .NET Framework 2.0 and I am aware of the XmlSchemaCollection ...
    (microsoft.public.dotnet.framework.webservices)