Altova Mailing List Archives>Archive Index >microsoft.public.xml Archive Home >Recent entries [Thread Prev] >Thread Next - Re: Error while trying to validate a schema - posting again Error while trying to validate a schema - posting againTo: NULL Date: 9/12/2008 2:29:00 PM Hi
the previous post got messed up, posting again:
Dim oSettings As New XmlReaderSettings
oSettings.ValidationType = ValidationType.Schema
oSettings.ValidationFlags =
XmlSchemaValidationFlags.ProcessInlineSchema
Dim xmlr As XmlReader
xmlr = XmlReader.Create(reader, oSettings)
Dim myschema1 As XmlSchema = XmlSchema.Read(xmlr,
AddressOf ValidationCallback)
so far, pretty much textboook code. problem is, it doesnt even begin
to validate! I get:
"The root element of a W3C XML Schema should be <schema> and its
namespace should be 'http://www.w3.org/2001/XMLSchema'."
why is that? here is the XML (it has an inline schema... which is why
i set that option in my code)
thanks in advance!
----------------------------------------------------------------------
<?xml version="1.0" encoding="utf-8"?>
<xml xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:schema >
<xsd:element name="PL_PRICELISTCOUNTRYCUSTOMERTYPENAME">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:maxLength value="71"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="PLDTL_ACDINDICATOR"></xsd:element>
<xsd:element name="PL_COUNTRYNAME">
<xsd:simpleType><xsd:restriction base="xsd:string"><xsd:maxLength
value="35"/>
</xsd:restriction></xsd:simpleType>
</xsd:element>
<xsd:element name="ITM_PARTNUMBER">
<xsd:simpleType><xsd:restriction base="xsd:string"><xsd:maxLength
value="16"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="ITM_ITEMNAME">
<xsd:simpleType><xsd:restriction base="xsd:string"><xsd:maxLength
value="80"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="pricelist"><xsd:complexType>
<xsd:sequence>
<xsd:element ref="PL_PRICELISTCOUNTRYCUSTOMERTYPENAME"/>
<xsd:element ref="PLDTL_ACDINDICATOR"/>
<xsd:element ref="PL_COUNTRYNAME"/>
<xsd:element ref="ITM_PARTNUMBER"/>
<xsd:element ref="ITM_ITEMNAME"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<pricelistroot>
<pricelist>
<PL_PRICELISTCOUNTRYCUSTOMERTYPENAME>United States Direct To
Reseller</PL_PRICELISTCOUNTRYCUSTOMERTYPENAME>
<PLDTL_ACDINDICATOR>NONE</PLDTL_ACDINDICATOR>
<PL_COUNTRYNAME>United States</PL_COUNTRYNAME>
<ITM_PARTNUMBER>021-06069</ITM_PARTNUMBER>
<ITM_ITEMNAME>Office Arabic CmprhnKit MVL CD</ITM_ITEMNAME>
</pricelist>
</pricelistroot>
</xml>
| ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
