Groups | Blog | Home
all groups > dotnet xml > september 2004 >

dotnet xml : Xml Schema: won't validate


Zafar Abbas [MSFT]
9/9/2004 9:39:27 AM
You must declare "project" as the default namespace in your schema. Just add
a xmlns="project" attribute on the xs:schema element like:

<xs:schema targetNamespace="project" elementFormDefault="qualified"
xmlns:mstns="http://tempuri.org/XMLSchema.xsd"
xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="project">


[quoted text, click to view]

George W.
9/9/2004 10:03:12 AM
Can someone help me with this? I keep double checking my schema layout
and it looks like my implementation is correct... yet it must not be.

I have the following schema which is invalid (Says: C:\Work\WIMAR
XML\WIMARKeyedText.xsd(7): Type 'ImageHeaderType' is not declared. An
error occurred at C:\Work\WIMAR XML\WIMARKeyedTexttest.xsd, (12, 6).
):
<?xml version="1.0" encoding="utf-8" ?>
<xs:schema targetNamespace="project" elementFormDefault="qualified"
xmlns:mstns="http://tempuri.org/XMLSchema.xsd"
xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="Roll">
<xs:complexType>
<xs:choice maxOccurs="unbounded">
<xs:element name="ImageHeader" type="ImageHeaderType" />
<xs:element name="RD" type="RDType" />
</xs:choice>
<xs:attribute name="number" use="required">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:pattern value="WI_M_\d{1,3}" />
</xs:restriction>
</xs:simpleType>
</xs:attribute>
</xs:complexType>
</xs:element>
<xs:complexType name="ImageHeaderType">
</xs:complexType>
<xs:complexType name="RDType">
</xs:complexType>
George W.
9/9/2004 10:56:11 AM
Awesome! Thank you much!

[quoted text, click to view]
AddThis Social Bookmark Button