<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1">
<title></title>
</head>
<body>
Please read the FAQ (section 3.2). You have to let xmlsec/libxml2
information<br>
about ID attributes. In the first example, ID attributes are declared
in DTD.<br>
I've not tried to use XSD with xmlsec myself but it seems that in your
second <br>
example either XSD is not loaded or ID attributes are not processed<br>
as expected. As far as I know, schemas support in LibXML2 is not
finished yet<br>
and both results are expected. The best you can do is get a debugger and<br>
find out what is going on. And patches are gladly accepted by both
xmlsec<br>
and libxml :)<br>
<br>
Aleksey<br>
<br>
<br>
<br>
Francisco Lechón wrote:<br>
<blockquote type="cite"
cite="midLaw15-F74jBsVVP9AtF00030a3b@hotmail.com"> <br>
Hi : <br>
<br>
I explain the problem to you that I have: <br>
<br>
If I use DTD everything works well. If I want to sign a part of
document XML, for example, I want to sign the identified element
id="KKKK "(test_dtd.xml), is generated the signature correctly. <br>
<br>
But the problems happen when I use XSD. I am having problems when I
want to sign single a part of the document, for example, if I want to
sign the referenced element with the identifier id="KKKK
"(test_xsd.xml). <br>
<br>
The error that happens is the following one: <br>
(d:\xmlseclibrary\xmlsec-0.0.14\src\transforms.c:1182): error 4: xml
operation failed : xmlXPtrEval(DDDD) <br>
(d:\xmlseclibrary\xmlsec-0.0.14\src\transforms.c:881): error 2:
xmlsec operation failed : xmlSecTransformStateParseUri(#DDDD) <br>
(d:\xmlseclibrary\xmlsec-0.0.14\src\xmldsig.c:1605): error 2: xmlsec
operation failed : xmlSecTransformStateCreate <br>
(d:\xmlseclibrary\xmlsec-0.0.14\src\xmldsig.c:1476): error 2: xmlsec
operation failed : xmlSecReferenceRead - -1 <br>
<br>
It supports xmlSec schemes XSD? <br>
It could help me somehow. <br>
<br>
Associate the documents that I use. <br>
<br>
test_dtd.xml <br>
<?xml version="1.0" encoding="UTF-8"?> <br>
<!-- edited with XMLSPY v5 rel. 3 U (<a class="moz-txt-link-freetext" href="http://www.xmlspy.com">http://www.xmlspy.com</a>) by paco
(kkk) --> <br>
<!DOCTYPE Root SYSTEM
<a class="moz-txt-link-rfc2396E" href="http://192.168.0.3:8080/xmlTimeStampingServicePort/plantillas/test_dtd.dtd">"http://192.168.0.3:8080/xmlTimeStampingServicePort/plantillas/test_dtd.dtd"</a>> <br>
<Root> <br>
<Data Id="KKKK"> <br>
The data I want to sign <br>
</Data> <br>
<Data2>Estos datos no son firmados</Data2> <br>
<Data3 Id="DDDD">Los datos que quiero firmar</Data3> <br>
</Root> <br>
<br>
test_dtd.dtd <br>
<!ELEMENT Root (Data,Data2,Data3)> <br>
<!ELEMENT Data (#PCDATA)> <br>
<!ATTLIST Data Id ID #REQUIRED> <br>
<!ELEMENT Data2 (#PCDATA)> <br>
<!ELEMENT Data3 (#PCDATA)> <br>
<!ATTLIST Data3 Id ID #REQUIRED> <br>
<br>
<br>
test_xsd.xml <br>
<?xml version="1.0" encoding="UTF-8"?> <br>
<!-- edited with XMLSPY v5 rel. 3 U (<a class="moz-txt-link-freetext" href="http://www.xmlspy.com">http://www.xmlspy.com</a>) by paco
(kkk) --> <br>
<Root xmlns:xsi=<a class="moz-txt-link-rfc2396E" href="http://www.w3.org/2001/XMLSchema-instance">"http://www.w3.org/2001/XMLSchema-instance"</a>
xsi:noNamespaceSchemaLocation=<a class="moz-txt-link-rfc2396E" href="http://192.168.0.3:8080/xmlTimeStampingServicePort/plantillas/test_xsd.xsd">"http://192.168.0.3:8080/xmlTimeStampingServicePort/plantillas/test_xsd.xsd"</a>> <br>
<Data Id="KKKK"> <br>
The data I want to sign <br>
</Data> <br>
<Data2>Estos datos no son firmados</Data2> <br>
<Data3 Id="DDDD">Los datos que quiero firmar</Data3> <br>
</Root> <br>
<br>
test_xsd.xsd <br>
<?xml version="1.0" encoding="UTF-8"?> <br>
<!-- edited with XMLSPY v5 rel. 3 U (<a class="moz-txt-link-freetext" href="http://www.xmlspy.com">http://www.xmlspy.com</a>) by paco
(kkk) --> <br>
<!--W3C Schema generated by XMLSPY v5 rel. 3 U
(<a class="moz-txt-link-freetext" href="http://www.xmlspy.com">http://www.xmlspy.com</a>)--> <br>
<xs:schema xmlns:xs=<a class="moz-txt-link-rfc2396E" href="http://www.w3.org/2001/XMLSchema">"http://www.w3.org/2001/XMLSchema"</a>
elementFormDefault="qualified"> <br>
<xs:element name="Data"> <br>
<xs:complexType> <br>
<xs:simpleContent> <br>
<xs:extension base="xs:string"> <br>
<xs:attribute name="Id" type="xs:ID" use="required"/> <br>
</xs:extension> <br>
</xs:simpleContent> <br>
</xs:complexType> <br>
</xs:element> <br>
<xs:element name="Data2" type="xs:string"/> <br>
<xs:element name="Data3"> <br>
<xs:complexType> <br>
<xs:simpleContent> <br>
<xs:extension base="xs:string"> <br>
<xs:attribute name="Id" type="xs:ID" use="required"/> <br>
</xs:extension> <br>
</xs:simpleContent> <br>
</xs:complexType> <br>
</xs:element> <br>
<xs:element name="Root"> <br>
<xs:complexType> <br>
<xs:sequence> <br>
<xs:element ref="Data"/> <br>
<xs:element ref="Data2"/> <br>
<xs:element ref="Data3"/> <br>
</xs:sequence> <br>
</xs:complexType> <br>
</xs:element> <br>
</xs:schema> <br>
<br>
A greeting. <br>
Thanks. <br>
<br>
_________________________________________________________________ <br>
Charla con tus amigos en línea mediante MSN Messenger:
<a class="moz-txt-link-freetext" href="http://messenger.microsoft.com/es">http://messenger.microsoft.com/es</a> <br>
</blockquote>
</body>
</html>