I have an XSD which has an import to an XSD located on the web which has a DTD within it. (Using VS-2005 2.0 framework)
If I load the XSD using the following, it can't find elements defined within the "xmldsig-core-schema.xsd" file, when I validate.
If I explicitly load the xsd from the web, I can validate except when the doc has a element which requires a definition that is in the XSD on the web.
FOR example:
-- Load xsd
I get the following type of error
Any Ideas as to why this is or how to correct the problem? (WS-TDL.XSD file being loaded is listed below)
[HTML]
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:aix_tdl=" http://www.accessitx.c om/TDL_Interface" elementFormDefa ult="qualified" attributeFormDe fault="unqualif ied">
<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.accessitx.c om/TDL_Interface" schemaLocation= "TDL_Interface. xsd" />
<xs:complexTy pe name="TDLReques t_DateType">
<xs:sequence>
<xs:element name="StartDate " type="xs:dateTi me" />
<xs:element name="EndDate" type="xs:dateTi me" />
</xs:sequence>
</xs:complexType>
<xs:complexTy pe name="TDLReques t_SNType">
<xs:sequence>
<xs:element name="SerialNum ber" type="xs:string " />
</xs:sequence>
</xs:complexType>
<xs:complexTy pe name="TDLReques t_X509NameType" >
<xs:sequence>
<xs:element name="X509Issue rSerial" type="ds:X509Is suerSerialType" minOccurs="0" />
<xs:element name="X509Subje ctName" type="xs:string " minOccurs="0" />
</xs:sequence>
</xs:complexType>
<xs:complexTy pe name="TDLReques t_All">
<xs:sequence>
<xs:element name="All" />
</xs:sequence>
</xs:complexType>
<xs:element name="TDLReques t">
<xs:complexType >
<xs:sequence>
<xs:element name="SequenceI D" type="xs:long" />
<xs:element name="UserNameT oken" type="xs:base64 Binary" />
<xs:element name="RequestPa yload" type="TDLReques t_PayloadType" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:complexTy pe name="TDLReques t_PayloadType">
<xs:choice>
<xs:element name="Certifica tionDateRange" type="TDLReques t_DateType" />
<xs:element name="Installat ionDateRange" type="TDLReques t_DateType" />
<xs:element name="ChangedDa teRange" type="TDLReques t_DateType" />
<xs:element name="SerialNo" type="TDLReques t_SNType" />
<xs:element name="X509Name" type="TDLReques t_X509NameType" />
<xs:element name="All" type="TDLReques t_All" />
</xs:choice>
</xs:complexType>
<xs:complexTy pe name="tdlAction ">
<xs:simpleConte nt>
<xs:extension base="xs:string ">
<xs:attribute name="scope" type="xs:anyURI " use="optional" default="http://www.accessitx.c om/TDL_Interface#a ction" />
</xs:extension>
</xs:simpleConten t>
</xs:complexType>
<xs:element name="TDLUpdate ">
<xs:complexType >
<xs:sequence>
<xs:element name="SequenceI D" type="xs:long" />
<xs:element name="UserNameT oken" type="xs:base64 Binary" />
<xs:element name="UpdatePay load">
<xs:complexType >
<xs:sequence>
<xs:element name="Action" type="tdlAction " />
<xs:choice>
<xs:element name="Add">
<xs:complexType >
<xs:sequence maxOccurs="unbo unded">
<xs:element name="Site" type="aix_tdl:F acilityType" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Update">
<xs:complexType >
<xs:sequence>
<xs:element name="Old_Site" type="aix_tdl:F acilityType" />
<xs:element name="New_Site" type="aix_tdl:F acilityType" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Delete">
<xs:complexType >
<xs:sequence maxOccurs="unbo unded">
<xs:element name="Site" type="aix_tdl:F acilityType" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:choice>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="TDLRespon se">
<xs:complexType >
<xs:choice>
<xs:element name="Ack" />
<xs:element name="Sites" type="aix_tdl:F acilityType" maxOccurs="unbo unded" />
</xs:choice>
</xs:complexType>
</xs:element>
</xs:schema>
[/HTML]
If I load the XSD using the following, it can't find elements defined within the "xmldsig-core-schema.xsd" file, when I validate.
[HTML]Dim oXmlReaderSetti ngs As New XmlReaderSettin gs()
oXmlReaderSetti ngs.ProhibitDtd = False
'-- Set for schema validation
oXmlReaderSetti ngs.ValidationT ype = ValidationType. Schema
oXmlReaderSetti ngs.Schemas.Add (Nothing, "WS-TDL.xsd")
Dim oRequestReader As New StringReader(.. .
Dim oPayloadXmlRead er As XmlReader = XmlReader.Creat e(oRequestReade r, oSchemasSetting s
[/HTML]oXmlReaderSetti ngs.ProhibitDtd = False
'-- Set for schema validation
oXmlReaderSetti ngs.ValidationT ype = ValidationType. Schema
oXmlReaderSetti ngs.Schemas.Add (Nothing, "WS-TDL.xsd")
Dim oRequestReader As New StringReader(.. .
Dim oPayloadXmlRead er As XmlReader = XmlReader.Creat e(oRequestReade r, oSchemasSetting s
If I explicitly load the xsd from the web, I can validate except when the doc has a element which requires a definition that is in the XSD on the web.
FOR example:
-- Load xsd
' do something like the following to explicitly load the xsd
oXmlReaderSetti ngs.Schemas.Add (Nothing,
http://www.w3.org/TR/2002/REC-xmldsi...re-schema.xsd)
oXmlReaderSetti ngs.Schemas.Add (Nothing,
http://www.w3.org/TR/2002/REC-xmldsi...re-schema.xsd)
I get the following type of error
The element 'X509IssuerSeri al' has invalid child element 'X509IssuerName '. List of possible elements expected: 'X509IssuerName ' in namespace 'http://www.w3.org/2000/09/xmldsig#'.
Any Ideas as to why this is or how to correct the problem? (WS-TDL.XSD file being loaded is listed below)
[HTML]
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:aix_tdl=" http://www.accessitx.c om/TDL_Interface" elementFormDefa ult="qualified" attributeFormDe fault="unqualif ied">
<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.accessitx.c om/TDL_Interface" schemaLocation= "TDL_Interface. xsd" />
<xs:complexTy pe name="TDLReques t_DateType">
<xs:sequence>
<xs:element name="StartDate " type="xs:dateTi me" />
<xs:element name="EndDate" type="xs:dateTi me" />
</xs:sequence>
</xs:complexType>
<xs:complexTy pe name="TDLReques t_SNType">
<xs:sequence>
<xs:element name="SerialNum ber" type="xs:string " />
</xs:sequence>
</xs:complexType>
<xs:complexTy pe name="TDLReques t_X509NameType" >
<xs:sequence>
<xs:element name="X509Issue rSerial" type="ds:X509Is suerSerialType" minOccurs="0" />
<xs:element name="X509Subje ctName" type="xs:string " minOccurs="0" />
</xs:sequence>
</xs:complexType>
<xs:complexTy pe name="TDLReques t_All">
<xs:sequence>
<xs:element name="All" />
</xs:sequence>
</xs:complexType>
<xs:element name="TDLReques t">
<xs:complexType >
<xs:sequence>
<xs:element name="SequenceI D" type="xs:long" />
<xs:element name="UserNameT oken" type="xs:base64 Binary" />
<xs:element name="RequestPa yload" type="TDLReques t_PayloadType" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:complexTy pe name="TDLReques t_PayloadType">
<xs:choice>
<xs:element name="Certifica tionDateRange" type="TDLReques t_DateType" />
<xs:element name="Installat ionDateRange" type="TDLReques t_DateType" />
<xs:element name="ChangedDa teRange" type="TDLReques t_DateType" />
<xs:element name="SerialNo" type="TDLReques t_SNType" />
<xs:element name="X509Name" type="TDLReques t_X509NameType" />
<xs:element name="All" type="TDLReques t_All" />
</xs:choice>
</xs:complexType>
<xs:complexTy pe name="tdlAction ">
<xs:simpleConte nt>
<xs:extension base="xs:string ">
<xs:attribute name="scope" type="xs:anyURI " use="optional" default="http://www.accessitx.c om/TDL_Interface#a ction" />
</xs:extension>
</xs:simpleConten t>
</xs:complexType>
<xs:element name="TDLUpdate ">
<xs:complexType >
<xs:sequence>
<xs:element name="SequenceI D" type="xs:long" />
<xs:element name="UserNameT oken" type="xs:base64 Binary" />
<xs:element name="UpdatePay load">
<xs:complexType >
<xs:sequence>
<xs:element name="Action" type="tdlAction " />
<xs:choice>
<xs:element name="Add">
<xs:complexType >
<xs:sequence maxOccurs="unbo unded">
<xs:element name="Site" type="aix_tdl:F acilityType" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Update">
<xs:complexType >
<xs:sequence>
<xs:element name="Old_Site" type="aix_tdl:F acilityType" />
<xs:element name="New_Site" type="aix_tdl:F acilityType" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Delete">
<xs:complexType >
<xs:sequence maxOccurs="unbo unded">
<xs:element name="Site" type="aix_tdl:F acilityType" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:choice>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="TDLRespon se">
<xs:complexType >
<xs:choice>
<xs:element name="Ack" />
<xs:element name="Sites" type="aix_tdl:F acilityType" maxOccurs="unbo unded" />
</xs:choice>
</xs:complexType>
</xs:element>
</xs:schema>
[/HTML]
Comment