hi.
I am using c#, visual studio 2003.
I need to validate a xml file against schema which itself has 2 more schema imported under it.
i have following 2 xsd files :
xsd1 --->
-------------------
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema
xmlns:core="http://www.trustedcomputinggroup.org/XML/SCHEMA/Core_Integrity_v1_0_1#"
xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:ds="http://www.w3.org/2000/09/xmldsig#"
xmlns="http://www.trustedcomputinggroup.org/XML/SCHEMA/Integrity_Report_v1_0#"
targetNamespace="http://www.trustedcomputinggroup.org/XML/SCHEMA/Integrity_Report_v1_0#"
elementFormDefault="qualified" attributeFormDefault="unqualified" version="1.0">
<!-- imports -->
<!--<xs:import namespace="http://www.w3.org/2000/09/xmldsig#" schemaLocation="./xmldsig-core-schema.xsd"/>
-->
<xs:import namespace="http://www.w3.org/2000/09/xmldsig#" schemaLocation="http://www.w3.org/TR/2002/REC-xmldsig-core-20020212/xmldsig-core-schema.xsd"/>
<xs:import namespace="http://www.trustedcomputinggroup.org/XML/SCHEMA/Core_Integrity_v1_0_1#" schemaLocation="Core_Integrity_Manifest_v1_0_1.xsd "/>
<!-- type declarations -->
<xs:complexType name="CapVersionInfoType">
<xs:attribute name="Tag" type="xs:unsignedShort" use="required"/>
<xs:attribute name="VersionMajor" type="xs:unsignedByte" use="required"/>
<xs:attribute name="VersionMinor" type="xs:unsignedByte" use="required"/>
<xs:attribute name="VersionRevMajor" type="xs:unsignedByte" use="required"/>
<xs:attribute name="VersionRevMinor" type="xs:unsignedByte" use="required"/>
<xs:attribute name="SpecLevel" type="xs:unsignedShort" use="required"/>
<xs:attribute name="ErrataRev" type="xs:unsignedByte" use="required"/>
<xs:attribute name="TpmVendorID" type="xs:normalizedString" use="required"/>
<xs:attribute name="VendorSpecificSize" type="xs:unsignedShort" use="required"/>
<xs:attribute name="VendorSpecific" type="xs:base64Binary" use="optional"/>
</xs:complexType>
<xs:complexType name="QuoteType">
<xs:sequence>
<xs:element name="PcrComposite" type="PcrCompositeType"/>
<xs:element name="QuoteInfo" type="QuoteInfoType"/>
<xs:element name="TpmInfo" minOccurs="0">
<xs:complexType>
<xs:choice>
<xs:element name="CapVersionInfo" type="CapVersionInfoType"/>
<xs:element name="TpmManufacturer" type="xs:normalizedString"/>
</xs:choice>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
<xs:complexType name="QuoteInfoType">
<xs:attribute name="VersionMajor" type="xs:unsignedByte" use="required"/>
<xs:attribute name="VersionMinor" type="xs:unsignedByte" use="required"/>
<xs:attribute name="VersionRevMajor" type="xs:unsignedByte" use="required"/>
<xs:attribute name="VersionRevMinor" type="xs:unsignedByte" use="required"/>
<xs:attribute name="Fixed" type="xs:normalizedString" use="required"/>
<xs:attribute name="DigestValue" type="ds:DigestValueType" use="required"/>
<xs:attribute name="ExternalData" type="xs:base64Binary" use="required"/>
</xs:complexType>
<xs:complexType name="Quote2Type">
<xs:sequence>
<xs:element name="QuoteInfo2" type="QuoteInfo2Type"/>
<xs:element name="CapVersionInfo" type="CapVersionInfoType" minOccurs="0"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="QuoteInfo2Type">
<xs:sequence>
<xs:element name="PcrInfoShort" type="PcrInfoShortType"/>
</xs:sequence>
<xs:attribute name="Tag" type="xs:unsignedShort" use="required"/>
<xs:attribute name="Fixed" type="xs:normalizedString" use="required"/>
<xs:attribute name="ExternalData" type="xs:base64Binary" use="required"/>
</xs:complexType>
<xs:complexType name="PcrSelectionType">
<xs:attribute name="SizeOfSelect" type="xs:unsignedShort" use="required"/>
<xs:attribute name="PcrSelect" type="xs:base64Binary" use="required"/>
</xs:complexType>
<xs:complexType name="PcrCompositeType">
<xs:sequence>
<xs:element name="PcrSelection" type="PcrSelectionType"/>
<xs:element name="ValueSize" type="xs:unsignedLong"/>
<xs:element name="PcrValue" maxOccurs="unbounded">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="ds:DigestValueType">
<xs:attribute name="SnapshotRef" type="xs:IDREF" use="optional"/>
<xs:attribute name="PcrNumber" type="xs:unsignedLong" use="required"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
<xs:complexType name="PcrInfoShortType">
<xs:sequence>
<xs:element name="PcrSelection" type="PcrSelectionType"/>
<xs:element name="LocalityAtRelease" type="xs:unsignedByte"/>
<xs:element name="CompositeHash" type="ds:DigestValueType"/>
<xs:element name="PcrComposite" type="PcrCompositeType"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="QuoteSignatureType">
<xs:sequence>
<xs:element name="CanonicalizationMethod" type="ds:CanonicalizationMethodType" minOccurs="0"/>
<xs:element name="SignatureMethod" type="ds:SignatureMethodType"/>
<xs:element name="SignatureValue" type="ds:SignatureValueType"/>
<xs:element name="KeyInfo" type="ds:KeyInfoType"/>
<xs:element name="ObjectType" type="ds:ObjectType" minOccurs="0"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="QuoteDataType">
<xs:sequence>
<xs:choice>
<xs:element name="Quote" type="QuoteType"/>
<xs:element name="Quote2" type="Quote2Type"/>
</xs:choice>
<xs:element name="TpmSignature" type="QuoteSignatureType"/>
</xs:sequence>
<xs:attribute name="ID" type="xs:ID" use="required"/>
</xs:complexType>
<xs:complexType name="CompositeHashType">
<xs:simpleContent>
<xs:extension base="core:HashType">
<xs:attribute name="Name" type="xs:normalizedString"/>
<xs:attribute name="Number" type="xs:integer"/>
<xs:attribute name="StartHash" type="ds:DigestValueType"/>
<xs:attribute name="SyncRef" type="xs:IDREF"/>
<xs:attribute name="Timestamp" type="xs:dateTime"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
<xs:complexType name="TpmDigestValueType">
<xs:simpleContent>
<xs:extension base="core:HashType">
<xs:attribute name="Locality" type="xs:integer"/>
<xs:attribute name="IsResetable" type="xs:boolean" use="required"/>
<xs:attribute name="Name" type="xs:normalizedString"/>
<xs:attribute name="Number" type="xs:integer"/>
<xs:attribute name="StartHash" type="ds:DigestValueType" use="required"/>
<xs:attribute name="SyncRef" type="xs:IDREF"/>
<xs:attribute name="Timestamp" type="xs:dateTime"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
<xs:complexType name="SnapshotType">
<xs:complexContent>
<xs:extension base="core:IntegrityManifestType">
<xs:choice minOccurs="0">
<xs:element name="CompositeHash" type="CompositeHashType" maxOccurs="unbounded"/>
<xs:element name="PcrHash" type="TpmDigestValueType" maxOccurs="unbounded"/>
</xs:choice>
<xs:attribute name="UUID" type="xs:NMTOKEN" use="required"/>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:element name="Snapshot" type="SnapshotType"/>
<xs:complexType name="ReportType">
<xs:sequence>
<xs:element name="SignerInfo" type="core:SignerInfoType" minOccurs="0"/>
<xs:element name="ConfidenceValue" type="core:ConfidenceValueType" minOccurs="0"/>
<xs:element name="QuoteData" type="QuoteDataType" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="SnapshotCollection" type="SnapshotType" maxOccurs="unbounded"/>
</xs:sequence>
<xs:attribute name="ID" type="xs:ID" use="required"/>
<xs:attribute name="UUID" type="xs:NMTOKEN" use="required"/>
<xs:attribute name="SyncSnapshotRefs" type="xs:IDREFS"/>
<xs:attribute name="TransitiveTrustPath" type="xs:IDREFS"/>
</xs:complexType>
<xs:element name="Report" type="ReportType"/>
</xs:schema>
------------------------
and xsd 2 ->
------------------------
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema
xmlns:core="http://www.trustedcomputinggroup.org/XML/SCHEMA/Core_Integrity_v1_0_1#"
xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:ds="http://www.w3.org/2000/09/xmldsig#"
xmlns="http://www.trustedcomputinggroup.org/XML/SCHEMA/Integrity_Report_v1_0#"
targetNamespace="http://www.trustedcomputinggroup.org/XML/SCHEMA/Integrity_Report_v1_0#"
elementFormDefault="qualified" attributeFormDefault="unqualified" version="1.0">
<!-- imports -->
<!--<xs:import namespace="http://www.w3.org/2000/09/xmldsig#" schemaLocation="./xmldsig-core-schema.xsd"/>
-->
<xs:import namespace="http://www.w3.org/2000/09/xmldsig#" schemaLocation="http://www.w3.org/TR/2002/REC-xmldsig-core-20020212/xmldsig-core-schema.xsd"/>
<xs:import namespace="http://www.trustedcomputinggroup.org/XML/SCHEMA/Core_Integrity_v1_0_1#" schemaLocation="Core_Integrity_Manifest_v1_0_1.xsd "/>
<!-- type declarations -->
<xs:complexType name="CapVersionInfoType">
<xs:attribute name="Tag" type="xs:unsignedShort" use="required"/>
<xs:attribute name="VersionMajor" type="xs:unsignedByte" use="required"/>
<xs:attribute name="VersionMinor" type="xs:unsignedByte" use="required"/>
<xs:attribute name="VersionRevMajor" type="xs:unsignedByte" use="required"/>
<xs:attribute name="VersionRevMinor" type="xs:unsignedByte" use="required"/>
<xs:attribute name="SpecLevel" type="xs:unsignedShort" use="required"/>
<xs:attribute name="ErrataRev" type="xs:unsignedByte" use="required"/>
<xs:attribute name="TpmVendorID" type="xs:normalizedString" use="required"/>
<xs:attribute name="VendorSpecificSize" type="xs:unsignedShort" use="required"/>
<xs:attribute name="VendorSpecific" type="xs:base64Binary" use="optional"/>
</xs:complexType>
<xs:complexType name="QuoteType">
<xs:sequence>
<xs:element name="PcrComposite" type="PcrCompositeType"/>
<xs:element name="QuoteInfo" type="QuoteInfoType"/>
<xs:element name="TpmInfo" minOccurs="0">
<xs:complexType>
<xs:choice>
<xs:element name="CapVersionInfo" type="CapVersionInfoType"/>
<xs:element name="TpmManufacturer" type="xs:normalizedString"/>
</xs:choice>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
<xs:complexType name="QuoteInfoType">
<xs:attribute name="VersionMajor" type="xs:unsignedByte" use="required"/>
<xs:attribute name="VersionMinor" type="xs:unsignedByte" use="required"/>
<xs:attribute name="VersionRevMajor" type="xs:unsignedByte" use="required"/>
<xs:attribute name="VersionRevMinor" type="xs:unsignedByte" use="required"/>
<xs:attribute name="Fixed" type="xs:normalizedString" use="required"/>
<xs:attribute name="DigestValue" type="ds:DigestValueType" use="required"/>
<xs:attribute name="ExternalData" type="xs:base64Binary" use="required"/>
</xs:complexType>
<xs:complexType name="Quote2Type">
<xs:sequence>
<xs:element name="QuoteInfo2" type="QuoteInfo2Type"/>
<xs:element name="CapVersionInfo" type="CapVersionInfoType" minOccurs="0"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="QuoteInfo2Type">
<xs:sequence>
<xs:element name="PcrInfoShort" type="PcrInfoShortType"/>
</xs:sequence>
<xs:attribute name="Tag" type="xs:unsignedShort" use="required"/>
<xs:attribute name="Fixed" type="xs:normalizedString" use="required"/>
<xs:attribute name="ExternalData" type="xs:base64Binary" use="required"/>
</xs:complexType>
<xs:complexType name="PcrSelectionType">
<xs:attribute name="SizeOfSelect" type="xs:unsignedShort" use="required"/>
<xs:attribute name="PcrSelect" type="xs:base64Binary" use="required"/>
</xs:complexType>
<xs:complexType name="PcrCompositeType">
<xs:sequence>
<xs:element name="PcrSelection" type="PcrSelectionType"/>
<xs:element name="ValueSize" type="xs:unsignedLong"/>
<xs:element name="PcrValue" maxOccurs="unbounded">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="ds:DigestValueType">
<xs:attribute name="SnapshotRef" type="xs:IDREF" use="optional"/>
<xs:attribute name="PcrNumber" type="xs:unsignedLong" use="required"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
<xs:complexType name="PcrInfoShortType">
<xs:sequence>
<xs:element name="PcrSelection" type="PcrSelectionType"/>
<xs:element name="LocalityAtRelease" type="xs:unsignedByte"/>
<xs:element name="CompositeHash" type="ds:DigestValueType"/>
<xs:element name="PcrComposite" type="PcrCompositeType"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="QuoteSignatureType">
<xs:sequence>
<xs:element name="CanonicalizationMethod" type="ds:CanonicalizationMethodType" minOccurs="0"/>
<xs:element name="SignatureMethod" type="ds:SignatureMethodType"/>
<xs:element name="SignatureValue" type="ds:SignatureValueType"/>
<xs:element name="KeyInfo" type="ds:KeyInfoType"/>
<xs:element name="ObjectType" type="ds:ObjectType" minOccurs="0"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="QuoteDataType">
<xs:sequence>
<xs:choice>
<xs:element name="Quote" type="QuoteType"/>
<xs:element name="Quote2" type="Quote2Type"/>
</xs:choice>
<xs:element name="TpmSignature" type="QuoteSignatureType"/>
</xs:sequence>
<xs:attribute name="ID" type="xs:ID" use="required"/>
</xs:complexType>
<xs:complexType name="CompositeHashType">
<xs:simpleContent>
<xs:extension base="core:HashType">
<xs:attribute name="Name" type="xs:normalizedString"/>
<xs:attribute name="Number" type="xs:integer"/>
<xs:attribute name="StartHash" type="ds:DigestValueType"/>
<xs:attribute name="SyncRef" type="xs:IDREF"/>
<xs:attribute name="Timestamp" type="xs:dateTime"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
<xs:complexType name="TpmDigestValueType">
<xs:simpleContent>
<xs:extension base="core:HashType">
<xs:attribute name="Locality" type="xs:integer"/>
<xs:attribute name="IsResetable" type="xs:boolean" use="required"/>
<xs:attribute name="Name" type="xs:normalizedString"/>
<xs:attribute name="Number" type="xs:integer"/>
<xs:attribute name="StartHash" type="ds:DigestValueType" use="required"/>
<xs:attribute name="SyncRef" type="xs:IDREF"/>
<xs:attribute name="Timestamp" type="xs:dateTime"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
<xs:complexType name="SnapshotType">
<xs:complexContent>
<xs:extension base="core:IntegrityManifestType">
<xs:choice minOccurs="0">
<xs:element name="CompositeHash" type="CompositeHashType" maxOccurs="unbounded"/>
<xs:element name="PcrHash" type="TpmDigestValueType" maxOccurs="unbounded"/>
</xs:choice>
<xs:attribute name="UUID" type="xs:NMTOKEN" use="required"/>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:element name="Snapshot" type="SnapshotType"/>
<xs:complexType name="ReportType">
<xs:sequence>
<xs:element name="SignerInfo" type="core:SignerInfoType" minOccurs="0"/>
<xs:element name="ConfidenceValue" type="core:ConfidenceValueType" minOccurs="0"/>
<xs:element name="QuoteData" type="QuoteDataType" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="SnapshotCollection" type="SnapshotType" maxOccurs="unbounded"/>
</xs:sequence>
<xs:attribute name="ID" type="xs:ID" use="required"/>
<xs:attribute name="UUID" type="xs:NMTOKEN" use="required"/>
<xs:attribute name="SyncSnapshotRefs" type="xs:IDREFS"/>
<xs:attribute name="TransitiveTrustPath" type="xs:IDREFS"/>
</xs:complexType>
<xs:element name="Report" type="ReportType"/>
</xs:schema>
----------------------------
and my xml file is :
----------------------------
<?xml version="1.0" encoding="UTF-8"?>
<Report xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.trustedcomputinggroup.org/XML/SCHEMA/Integrity_Report_v1_0# Integrity_Report_Manifest_v1_0.xsd"
xmlns:core="http://www.trustedcomputinggroup.org/XML/SCHEMA/Core_Integrity_v1_0_1#"
xmlns:stuff="http://www.trustedcomputinggroup.org/XML/SCHEMA/Simple_Object_v1_0#"
xmlns="http://www.trustedcomputinggroup.org/XML/SCHEMA/Integrity_Report_v1_0#"
ID="_C0136C73-93A9-4e4a-A056-70BDFE4A4A46"
SyncSnapshotRefs="_1901366E-1409-4eeb-99E1-1F4880034EEB"
UUID="C0136C73-93A9-4e4a-A056-70BDFE4A4A46">
<QuoteData ID="_82897509-2D8A-4061-A2D9-DA2975998C70">
<Quote>
<PcrComposite>
<PcrSelection SizeOfSelect="2" PcrSelect="AAQ="/>
<ValueSize>15</ValueSize>
<PcrValue PcrNumber="13">AqW6avizcmWIL0mTpWncin/NrPE=</PcrValue>
</PcrComposite>
<QuoteInfo VersionMinor="2" Fixed="QUOT"
ExternalData="BqW335izcmWIL0m09Wncin/NrPE="
DigestValue="AqW6avizcmWIL0mTpWncin/NrPE=" VersionMajor="1"
VersionRevMajor="1" VersionRevMinor="2"/>
</Quote>
<TpmSignature>
<CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"/>
<SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"/>
<SignatureValue>4Rxc/Nh/i6zYEumYbqhh8h+qTbGWowCKbEJgEH3rraxM1WMPYi3YdKR/D+2TNhBdPg3U7ydy6WwJ/
c6uULq7ywUREG0zjxY4Vxe4wxv269VXtXQNXwzPCwfVEVhbc+w Jw6HE4fhX6y4FCx2D6
djD9r2geIBRil0IfrU=</SignatureValue>
<KeyInfo>
<KeyValue>
<RSAKeyValue>
<Modulus>6h6uowDi1q5LAEyD3ghOdZcS9+VlwFeFwu+C9z4MR yunpeFKl0nZ2qtE97LoxHfKBxa+LJsRGbLOeGxZc9w3
me0VZzQJ8LsrIrbG+Mvtk4eZkEQrF02tpC/zIMe30T4B0kpYkI91elpeMp/n1RWzUH8+a/5cWVUnHT80=</Modulus>
<Exponent>AQAB</Exponent>
</RSAKeyValue>
</KeyValue>
</KeyInfo>
</TpmSignature>
</QuoteData>
<SnapshotCollection Id="_979ADB1F-E75B-4b94-9EFE-0FAD9C125549" RevLevel="0" UUID="979ADB1F-E75B-4b94-9EFE-0FAD9C125549">
<core:ComponentID Id="_4CD06805-5364-4d01-9722-BD3F2CA56788" SimpleName="Test Application">
<core:VendorID Name="Wave Systems Corp.">
<core:SmiVendorId>15997</core:SmiVendorId>
</core:VendorID>
</core:ComponentID>
<core:DigestMethod Id="sha1" Algorithm=""/>
<core:Values>
<stuff:SimpleSnapshotObject>
<stuff:Objects Name="c:\program files\test.h">
<stuff:Hash Id="_1092DFDD-2DDD-4cb1-A4A7-1A0C141E56FB"
AlgRef="sha1">7EbfD2FLhcDFxGdQE9/ZjskOGcw=</stuff:Hash>
</stuff:Objects>
</stuff:SimpleSnapshotObject>
</core:Values>
<CompositeHash Id="_779ADB1F-E75B-4b94-9EFE-0FAD9C125549"
AlgRef="sha1">7EbfD2FLhcDFxGdQE9/ZjskOGcw=</CompositeHash>
</SnapshotCollection>
<SnapshotCollection Id="_1901366E-1409-4eeb-99E1-1F4880034EEB" RevLevel="0" UUID="1901366E-1409-4eeb-99E1-1F4880034EEB">
<core:ComponentID Id="_234234" VersionBuild="4" VersionMajor="1" VersionMinor="2" SimpleName="PTS
Service" ModelSystemClass="NTRU">
<core:VendorID Name="Wave Systems">
<core:SmiVendorId>15997</core:SmiVendorId>
</core:VendorID>
</core:ComponentID>
<core:Collector>
<core:ComponentID Id="a12345" VersionBuild="4" VersionMajor="1" VersionMinor="2"
SimpleName="PTS Service" ModelSystemClass="NTRU">
<core:VendorID Name="Wave Systems">
<core:SmiVendorId>15997</core:SmiVendorId>
</core:VendorID>
</core:ComponentID>
</core:Collector>
<core:Values>
<stuff:SimpleSnapshotObject>
<stuff:Objects Name="C:\Program Files\Wave Systems Corp\PTS\ptsserver.exe">
<stuff:Hash Id="_D4D8A65C-EE5F-4693-BE21-56DE1BFC72DD"
AlgRef="sha1">7EbfD2FLhcDFxGdQE9/ZjskOGcw=</stuff:Hash>
</stuff:Objects>
<stuff:Objects Name="C:\Program Files\Wave Systems Corp\PTS\ptssdk.dll">
<stuff:Hash Id="_32D24FF8-8D52-49cb-9C21-430233E81576"
AlgRef="sha1">7EbfD2FLhcDFxGdQE9/ZjskOGcw=</stuff:Hash>
</stuff:Objects>
</stuff:SimpleSnapshotObject>
</core:Values>
</SnapshotCollection>
</Report>
------------------------------
and
I am using the following c# code :
--------------------
class Class1
{
private static bool isValid = true; // If a validation error occurs,
[STAThread]
static void Main(string[] args)
{
try
{
StreamReader rdr = new StreamReader(@"test.xml");
XmlParserContext context = new XmlParserContext(null, null, "", XmlSpace.None);
XmlValidatingReader v = new XmlValidatingReader(rdr.ReadToEnd(),XmlNodeType.El ement, context);
XmlSchemaCollection xsdCollection = new
XmlSchemaCollection();
xsdCollection.Add("http://www.trustedcomputinggroup.org/XML/SCHEMA/Integrity_Report_v1_0#", "Integrity_Report_Manifest_v1_0.xsd");
xsdCollection.Add("http://www.trustedcomputinggroup.org/XML/SCHEMA/Core_Integrity_v1_0_1#" , "Core_Integrity_Manifest_v1_0_1.xsd");
v.ValidationType = ValidationType.Schema;
v.Schemas.Add(xsdCollection);
v.ValidationEventHandler +=
new ValidationEventHandler(MyValidationEventHandler);
while (v.Read())
{
// Can add code here to process the content.
}
v.Close();
// Check whether the document is valid or invalid.
if (isValid)
Console.WriteLine("Document is valid");
else
Console.WriteLine("Document is invalid");
}
catch (XmlException XmlExp)
{
Console.WriteLine(XmlExp.Message);
}
catch(XmlSchemaException XmlSchExp)
{
Console.WriteLine(XmlSchExp.Message);
}
catch(Exception GenExp)
{
Console.WriteLine(GenExp.Message);
}
finally
{
Console.Read();
}
}
public static void MyValidationEventHandler(object sender,
ValidationEventArgs args)
{
isValid = false;
Console.WriteLine("Validation event\n" + args.Message);
}
}
}
--------------------------
When i Test this code using saxon/java based xml validator, it is validates. But under Dotnet it gives me the following error :
----------------------
"the derived type and the base type must have the same content type", and points the error at "line 59" of the "xsd 2".
where am i going wrong ??
regrds
tanish