[lxml-dev] XSD Validation: No matching global declaration.
John Lovell
jlovell at esd189.org
Thu Nov 8 18:22:35 CET 2007
>John Lovell wrote:
>> I don't know if my schema is invalid or if this represents a bug in
>> lxml or libxml2.
>> 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.
>I'm not so firm with libxml2's XML Schema implementation, not sure what
>that means exactly. Is it the only error you get in the log?
I get just one similar error in the log for every file I try to validate
with this schema. Only the elements name changes.
>> The same code given diffrent files works fine. Does anyone have any
>> ideas why I am getting this message?
>You can check if "xmllint" (which is the command line tool that comes
with
>libxml2) produces the same error. It is actually unlikely that this is
an
>lxml problem, so this would tell you if libxml2 really thinks that your
>file is invalid. In that case, you can ask on the libxml2 mailing list
>instead.
Okay here we go...
jlovell at esd189-10545:~/SIF Toolkit/Data Generator$ xmllint --schema
combined.txt
../1.5r1/XSD/Infrastructure/Authentication__Authentication.xml
<?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>
../1.5r1/XSD/Infrastructure/Authentication__Authentication.xml:2:
element Authentication: Schemas validity error : Element
'Authentication': No matching global declaration available for the
validation root.
../1.5r1/XSD/Infrastructure/Authentication__Authentication.xml fails to
validate
You are right it isn't an lxml problem! Sorry, but I had to start
somewhere.
>Maybe you can also check with a different tool, that might give you
more
>hints on what is wrong here.
Good idea here is the output from: http://www.xmlme.com/Validator.aspx
Validation Results:
Schema Error: System.Xml.Schema.XmlSchemaException: The targetNamespace
parameter '' should be the same value as the targetNamespace
'http://www.sifinfo.org/infrastructure/1.x' of the schema. at
System.Xml.Schema.BaseProcessor.SendValidationEvent(XmlSchemaException
e, XmlSeverityType severity) at
System.Xml.Schema.SchemaCollectionPreprocessor.Preprocess(XmlSchema
schema, String targetNamespace, Compositor compositor) at
System.Xml.Schema.SchemaCollectionPreprocessor.Execute(XmlSchema schema,
String targetNamespace, Boolean loadExternals, XmlSchemaCollection xsc)
at System.Xml.Schema.XmlSchema.CompileSchema(XmlSchemaCollection xsc,
XmlResolver resolver, SchemaInfo schemaInfo, String ns,
ValidationEventHandler validationEventHandler, XmlNameTable nameTable,
Boolean CompileContentModel) at
System.Xml.Schema.XmlSchemaCollection.Add(String ns, SchemaInfo
schemaInfo, XmlSchema schema, Boolean compile, XmlResolver resolver) at
System.Xml.Schema.XmlSchemaCollection.Add(String ns, XmlReader reader,
XmlResolver resolver) at
System.Xml.Schema.XmlSchemaCollection.Add(String ns, XmlReader reader)
at Validator.Button1_Click(Object sender, EventArgs e)
Okay, so it is me. At this point, which mailing list should I be
bothering? If you know how I can set the targetNamespace of my document
to match my schema, please email me but consider carefully if it is
appropriate to copy this list.
Thanks for all your help,
John W. Lovell
Web Applications Engineer
Northwest Educational Service District
1601 R Avenue
Anacortes, WA 98221
www.esd189.org
Together We Can ...
More information about the lxml-dev
mailing list