[lxml-dev] XSD Validation: No matching global declaration.
John Lovell
jlovell at esd189.org
Thu Nov 8 01:21:28 CET 2007
Hi All:
I don't know if my schema is invalid or if this represents a bug in lxml
or libxml2.
Here is the situation...
I have a XML Schema that looks like this:
<schema
xmlns="http://www.w3.org/2001/XMLSchema"
xmlns:sif="http://www.sifinfo.org/infrastructure/1.x"
targetNamespace="http://www.sifinfo.org/infrastructure/1.x">
<import namespace="http://www.w3.org/XML/1998/namespace"
schemaLocation="http://www.w3.org/2001/xml.xsd"/>
...
<element name="Authentication">
<complexType>
<sequence>
<element ref="sif:AuthenticationInfo" minOccurs="0"
maxOccurs="unbounded"/>
<element ref="sif:SIF_ExtendedElements" minOccurs="0"
maxOccurs="1"/>
</sequence>
<attribute name="RefId" type="sif:RefIdType" use="required"/>
<attribute name="SifRefId" type="sif:RefIdType" use="required"/>
<attribute name="SifRefIdType" use="required">
<simpleType>
<restriction base="string">
<enumeration value="StudentPersonal"/>
<enumeration value="StaffPersonal"/>
<enumeration value="StudentContact"/>
<enumeration value="EmployeePersonal"/>
</restriction>
</simpleType>
</attribute>
</complexType>
</element>
...
</schema>
I am trying to validate this data:
<?xml version="1.0"?>
<Authentication xmlns:ns3="http://www.w3.org/2001/XMLSchema"
ns3:RefId="27D1CAEA85C2BAA647A01B551D21E1EB"
ns3:SifRefId="211242238C60A55E25B2B86BB337C244"
ns3:SifRefIdType="EmployeePersonal">
<AuthenticationInfo>
<System xmlns:ns0="http://www.w3.org/2001/XMLSchema"
ns0:Type="Application">&amp;1&lt;tNk44}F2</System>
<Username>;pl}ee&apos;-</Username>
<DistinguishedName>mlZm at JD</DistinguishedName>
<Password xmlns:ns1="http://www.w3.org/2001/XMLSchema"
ns1:Algorithm="MD5" ns1:KeyName="(v4kSY.">l1uqg!</Password>
</AuthenticationInfo>
<SIF_ExtendedElements>
<SIF_ExtendedElement xmlns:ns2="http://www.w3.org/2001/XMLSchema"
ns2:Name="%~T=">ZE72n/l</SIF_ExtendedElement>
</SIF_ExtendedElements>
</Authentication>
The error log shows the following error:
../1.5r1/XSD/Infrastructure/Authentication__Authentication.xml:2:ERROR:S
CHEMASV:SCHEMAV_CVC_ELT_1: Element 'Authentication': No matching global
declaration available for the validation root.
The same code given diffrent files works fine. Does anyone have any
ideas why I am getting this message?
Required version information:
lxml.etree: (1, 3, 4, 0)
libxml used: (2, 6, 30)
libxml compiled: (2, 6, 30)
libxslt used: (1, 1, 21)
libxslt compiled: (1, 1, 22)
Thanks,
John W. Lovell
Web Applications Engineer
Northwest Educational Service District
1601 R Avenue
Anacortes, WA 98221
<mailto:jlovell at esd189.org>
www.esd189.org <http://www.esd189.org/>
Together We Can ...
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://codespeak.net/pipermail/lxml-dev/attachments/20071107/2a250fd3/attachment-0001.htm
More information about the lxml-dev
mailing list