Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Error while trying to validate a schema - posting again

From: YoniSion@-----.---
To: 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>



transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent