Re: [xml] Old bug in xmlSchemaValidateOneElement function

Dear Daniel!
Thank you very much answering my mail, and taking my problem seriously. Don't worry about the time delay, I'm 
not running out of time yet.

I'm using your great library to parse and validate XAdES Electronic Singnatures defined by file. But thees signatures usually embedded in other XML 
structures like SOAP envelop.
Now, if I make a libxml2 doc out of the entire SOAP Envelop and try to validate the <Signature> tag against 
the above mentioned schema got the same error Tiberius got because the tags in the envelop - where the 
validation starts by mistake - like <S11:Envelope> or <S11:Header> cannot be found in the XAdES schema:
"Element '{}Envelope': No matching global declaration available for 
the validation root."
Attached you may find a SOAP Envelope embedding a XAdES Signature.

many thanks

Feladó: Daniel Veillard [veillard redhat com]
Küldve: 2013. március 13. 3:27
To: Csaba László
Cc: xml gnome org
Tárgy: Re: [xml] Old bug in xmlSchemaValidateOneElement function

On Tue, Mar 05, 2013 at 07:04:49AM +0000, Csaba László wrote:
Recently I have run into the very same problem Tiberius Duluman did back in Wed, 13 May 2009 15:56:55 +0300 
([xml] Bug in xmlSchemaValidateOneElement function). Now I can proof now that his problem is a valid 
problem. I checked the latest available version of xmlschemas.c (2.9.0.) and the problem is still there!
I think I'v found a solution to the problem which I'd like proof with you:
My quick solution to the problem is to replace line 27849 in xmlschemas.c (v2.9.0.) in function 
    valRoot = xmlDocGetRootElement(vctxt->doc);
with this one:
    valRoot = vctxt->validationRoot ? vctxt->validationRoot : xmlDocGetRootElement(vctxt->doc);
Currently I'm using version 2.7.8. in Windows and this change seems to solve the problem.
Would you be so kind the certify if this change is OK and will not harm something I do not see.

  Hi László,

sorry for the delay, your mail bounced because you are not subscribed
and I only saw it today (and would you mind subscribing at least until
we fix the issue ?

Yes the change looks sensible, but going back to Tiberius Duluman
mail I fetched RFC 4479, and the validation fails for a different

xmllint --noout --schema rfc4479_0.xsd rfc4479_0.xml
rfc4479_0.xml:6: element presence: Schemas validity error : Element
'{urn:ietf:params:xml:ns:pidf}presence': No matching global declaration
available for the validation root.

and indeed the RFC uses that schemas but doesn't define or reference it.
Do you have a simpler example which would be usable as a reproducing
test case for the regression suite ?



Daniel Veillard      | Open Source and Standards, Red Hat
veillard redhat com  | libxml Gnome XML XSLT toolkit | virtualization library

Attachment: 1000056_001_01-200810000003..XAdES.XML
Description: 1000056_001_01-200810000003..XAdES.XML

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]