473,397 Members | 2,068 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,397 software developers and data experts.

Xml Validation - Multiple xsd - c#

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
May 29 '07 #1
0 2634

Sign in to post your reply or Sign up for a free account.

Similar topics

21
by: Stefan Richter | last post by:
Hi, after coding for days on stupid form validations - Like: strings (min / max length), numbers(min / max value), money(min / max value), postcodes(min / max value), telefon numbers, email...
0
by: Richard Payne | last post by:
I am developing a web application that utilises multiple grids, panels, validation controls etc on the same page. I have added the appropriate code to pop up dialogs to confirm delete in...
4
by: Phil Powell | last post by:
Has anyone here ever done a case where you have a select multiple form element and you have to do both server-side and client-side validation? I am honestly not sure how to do it in Javascript (I...
4
by: earwicker | last post by:
I recently deployed a web application which contains a user registration form with the usual fields: name, address, email, password, etc. Each of the TextBoxes uses a validation control to verify...
7
by: A.M | last post by:
Hi, I have a validation control in my page that upon any invalid data, it disables all buttons in the page. basicly i don't have any postback in the page if the validator finds any error. How...
5
by: M | last post by:
Hi, it's possible to append a custom action to a client-side verification of a validation control ? I have a validator summary control that shows (automatically) a message box if the validation...
9
by: Bill Long | last post by:
I have a control that simply displays a list of links. Following one of the links doesn't post back or redirect to another page, it simply hides the current panel and shows the one you selected......
5
by: paul_zaoldyeck | last post by:
does anyone know how to validate an xml file against multiple defined schema? can you show me some examples? i'm making here an xml reader.. thank you
11
by: Rik | last post by:
Hello guys, now that I'm that I'm working on my first major 'open' forms (with uncontrolled users I mean, not a secure backend-interface), I'd like to add a lot of possibilities to check wether...
8
by: preeny8 | last post by:
Hi guys, So I'm editing an existing database (Access 2003), and I need a bit of help in making a validation rule. My table has many fields, 3 of which are indexed (location, number & revision) ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.