<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="test" targetNamespace="test"> <xsd:include schemaLocation="b.xsd" /> </xsd:schema>`
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <xsd:simpleType name="testType"> <xsd:restriction base="xsd:string"> <xsd:enumeration value="test"/> </xsd:restriction> </xsd:simpleType> <xsd:element name="test" type="testType"/> </xsd:schema>
XmlSchemaSet schemaSet = new XmlSchemaSet(); schemaSet.Add(null, @"a.xsd"); foreach (XmlSchema schema in schemaSet.Schemas()) // foreach is used to simplify the example { Console.WriteLine("Target namespace: "schema.TargetNamespace); // "Target namespace: test" XmlSchemaInclude include = (XmlSchemaInclude)schema.Includes[0]; Console.WriteLine("Include target namespace: " + include.Schema.TargetNamespace); // "Include target namespace: test" }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)