-
How to view a complete schema when using schema includes/imports?
I posted this question in the microsoft.public.dotnet.xml group the
other day, but I didn't get any responses. I thought I'd try here
next. I really need to figure this out.
I've got a parent schema file that references complex element types that are defined in several "child" schema files and I used the schema imports statement to include them into the parent schema's default namespace.
I'd like to generate a complete/single-file instance of the schema to simplify things but I can't figure out how to do it. Each schema seems to live in it's respective memory space inside the SchemaIncludes. Any idea how I could traverse all of the "virtual" nodes in the parent schema to create a physical representation of what the full schema looks like?
I'd appreciate any help I can get.
Thanks,
--jason
-
Just a little more clarification. I'm trying to physically look at the full / "master schema" like it would show up in an editor. I'm trying to create an XSLT to transform an instance of an xml doc with data and then validate it against the full schema. It would be a lot easier to work with the schema if it was all in one doc, but I don't have that option. The VS.Net schema editor displays the full schema, but I can't figure out how to do it programatically with .NET code.
Take the following files as an example:
Product.xsd
<?xml version="1.0"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://www.product.org"
xmlns="http://www.product.org"
elementFormDefault="unqualified">
<xsd:complexType name="ProductType">
<xsd:sequence>
<xsd:element name="Type" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
</xsd:schema>
Person.xsd
<?xml version="1.0"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://www.person.org"
xmlns="http://www.person.org"
elementFormDefault="unqualified">
<xsd:complexType name="PersonType">
<xsd:sequence>
<xsd:element name="Name" type="xsd:string"/>
<xsd:element name="SSN" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
</xsd:schema>
Company.xsd
<?xml version="1.0"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://www.company.org"
xmlns="http://www.company.org"
elementFormDefault="unqualified"
xmlns er="http://www.person.org"
xmlns ro="http://www.product.org">
<xsd:import namespace="http://www.person.org"
schemaLocation="Person.xsd"/>
<xsd:import namespace="http://www.product.org"
schemaLocation="Product.xsd"/>
<xsd:element name="Company">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="Person" type="per:PersonType"
maxOccurs="unbounded"/>
<xsd:element name="Product" type="pro:ProductType"
maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>
Question: I want to view the full version of the Company schema with the imported schema elements expanded with their child elements.
Thanks,
--jason
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Development Centers
-- Android Development Center
-- Cloud Development Project Center
-- HTML5 Development Center
-- Windows Mobile Development Center
|