[xmlsec] Problem with Id attributes and DTD

Brian Piccolo bpiccolo at pixelbridge.com
Thu Mar 25 11:19:00 PDT 2010


Hi Aleksey,

Thanks for your help!  I was able to get this to work by building out a complete DTD using an XML to DTD generator.  Works like a charm.  

Thanks again!
Brian 

-----Original Message-----
From: Aleksey Sanin [mailto:aleksey at aleksey.com] 
Sent: Thursday, March 25, 2010 12:06 PM
To: Brian Piccolo
Cc: 'xmlsec at aleksey.com'
Subject: Re: [xmlsec] Problem with Id attributes and DTD

Well, validity errors come from DTD validation itself and have
nothing to do with XMLDsig. You can clear or silence these errors
if you don't care. Or you can use --id-attr option (again, don't
forget about namespaces).

Aleksey

On 3/25/2010 7:51 AM, Brian Piccolo wrote:
> Thanks for the prompt response Aleksey!
>
> So adding the Namespace clears the issue with the validity error on the Id attribute, but I'm still receiving the error on all of the element attributes.  Do I need to build out the DTD to include all of the elements in the XML document?
>
> Based on the FAQ and some of the previous archive posts, it seemed like I only need to add the Id ATTLISTS, but I'm somewhat of a noob with this stuff so I don't know if it was implied that I need to include the other Elements as well.
>
> Thanks again for your help.
>
> Brian
>
>
>
> -----Original Message-----
> From: Aleksey Sanin [mailto:aleksey at aleksey.com]
> Sent: Thursday, March 25, 2010 10:36 AM
> To: Brian Piccolo
> Cc: 'xmlsec at aleksey.com'
> Subject: Re: [xmlsec] Problem with Id attributes and DTD
>
> You forgot about namespaces. Look at the errors:
>
> XMLSEC_TEST.xml:11: element Timestamp: validity error : No declaration
> for element Timestamp
> XMLSEC_TEST.xml:11: element Timestamp: validity error : No declaration
> for attribute Id of element Timestamp
>
> The DTD can't be matched to the xml file.
>
> Aleksey
>
> On 3/25/2010 7:15 AM, Brian Piccolo wrote:
>> Hello,
>> I've be reading all of the archival messages about FAQ section 3.2 and
>> creating a DTD to support an XML document with an "Id" attribute. I've
>> tried adding the ATTLIST to an external DTD file using the --dtd-file
>> option from the command line and also tried embedding the DTD into the
>> XML document. In both cases I've tried using both the
>> <!DOCTYPE>  declarion as well as just the<!ATTLIST but have not had any
>> luck.
>> Attached is a sample of my XML template and the DTD file I'm using and
>> below is the error message that I'm receiving.
>> Any information you can provide would be greatly appreciated.
>> Thanks for your help!
>> Brian
>> xmlsec1 sign --dtd-file test.dtd --output output.xml --hmackey key.php
>> XMLSEC_TEST.xml
>>
>> XMLSEC_TEST.xml:2: element Envelope: validity error : No declaration for
>> element Envelope
>> XMLSEC_TEST.xml:2: element Envelope: validity error : No declaration for
>> attribute xmlns:soap of element Envelope
>> XMLSEC_TEST.xml:2: element Envelope: validity error : No declaration for
>> attribute xmlns:wsa of element Envelope
>> XMLSEC_TEST.xml:2: element Envelope: validity error : No declaration for
>> attribute xmlns:wsse of element Envelope
>> XMLSEC_TEST.xml:2: element Envelope: validity error : No declaration for
>> attribute xmlns:wsu of element Envelope
>> XMLSEC_TEST.xml:3: element Header: validity error : No declaration for
>> element Header
>> XMLSEC_TEST.xml:4: element Action: validity error : No declaration for
>> element Action
>> XMLSEC_TEST.xml:4: element Action: validity error : No declaration for
>> attribute Id of element Action
>> XMLSEC_TEST.xml:5: element MessageID: validity error : No declaration
>> for element MessageID
>> XMLSEC_TEST.xml:5: element MessageID: validity error : No declaration
>> for attribute Id of element MessageID
>> XMLSEC_TEST.xml:6: element ReplyTo: validity error : No declaration for
>> element ReplyTo
>> XMLSEC_TEST.xml:6: element ReplyTo: validity error : No declaration for
>> attribute Id of element ReplyTo
>> XMLSEC_TEST.xml:7: element Address: validity error : No declaration for
>> element Address
>> XMLSEC_TEST.xml:9: element To: validity error : No declaration for
>> element To
>> XMLSEC_TEST.xml:9: element To: validity error : No declaration for
>> attribute Id of element To
>> XMLSEC_TEST.xml:10: element Security: validity error : No declaration
>> for element Security
>> XMLSEC_TEST.xml:10: element Security: validity error : No declaration
>> for attribute mustUnderstand of element Security
>> XMLSEC_TEST.xml:11: element Timestamp: validity error : No declaration
>> for element Timestamp
>> XMLSEC_TEST.xml:11: element Timestamp: validity error : No declaration
>> for attribute Id of element Timestamp
>> XMLSEC_TEST.xml:12: element Created: validity error : No declaration for
>> element Created
>> XMLSEC_TEST.xml:13: element Expires: validity error : No declaration for
>> element Expires
>> XMLSEC_TEST.xml:15: element UsernameToken: validity error : No
>> declaration for element UsernameToken
>> XMLSEC_TEST.xml:15: element UsernameToken: validity error : No
>> declaration for attribute Id of element UsernameToken
>> XMLSEC_TEST.xml:15: element UsernameToken: validity error : No
>> declaration for attribute xmlns:wsse of element UsernameToken
>> XMLSEC_TEST.xml:15: element UsernameToken: validity error : No
>> declaration for attribute xmlns:wsu of element UsernameToken
>> XMLSEC_TEST.xml:16: element Username: validity error : No declaration
>> for element Username
>> XMLSEC_TEST.xml:17: element Password: validity error : No declaration
>> for element Password
>> XMLSEC_TEST.xml:17: element Password: validity error : No declaration
>> for attribute Type of element Password
>> XMLSEC_TEST.xml:18: element Nonce: validity error : No declaration for
>> element Nonce
>> XMLSEC_TEST.xml:19: element Created: validity error : No declaration for
>> element Created
>> XMLSEC_TEST.xml:20: element ApplicationName: validity error : No
>> declaration for element ApplicationName
>> XMLSEC_TEST.xml:22: element Signature: validity error : No declaration
>> for element Signature
>> XMLSEC_TEST.xml:22: element Signature: validity error : No declaration
>> for attribute xmlns of element Signature
>> XMLSEC_TEST.xml:23: element SignedInfo: validity error : No declaration
>> for element SignedInfo
>> XMLSEC_TEST.xml:24: element CanonicalizationMethod: validity error : No
>> declaration for element CanonicalizationMethod
>> XMLSEC_TEST.xml:24: element CanonicalizationMethod: validity error : No
>> declaration for attribute Algorithm of element CanonicalizationMethod
>> XMLSEC_TEST.xml:25: element SignatureMethod: validity error : No
>> declaration for element SignatureMethod
>> XMLSEC_TEST.xml:25: element SignatureMethod: validity error : No
>> declaration for attribute Algorithm of element SignatureMethod
>> XMLSEC_TEST.xml:26: element Reference: validity error : No declaration
>> for element Reference
>> XMLSEC_TEST.xml:26: element Reference: validity error : No declaration
>> for attribute URI of element Reference
>> XMLSEC_TEST.xml:27: element Transforms: validity error : No declaration
>> for element Transforms
>> XMLSEC_TEST.xml:28: element Transform: validity error : No declaration
>> for element Transform
>> XMLSEC_TEST.xml:28: element Transform: validity error : No declaration
>> for attribute Algorithm of element Transform
>> XMLSEC_TEST.xml:30: element DigestMethod: validity error : No
>> declaration for element DigestMethod
>> XMLSEC_TEST.xml:30: element DigestMethod: validity error : No
>> declaration for attribute Algorithm of element DigestMethod
>> XMLSEC_TEST.xml:31: element DigestValue: validity error : No declaration
>> for element DigestValue
>> XMLSEC_TEST.xml:33: element Reference: validity error : No declaration
>> for element Reference
>> XMLSEC_TEST.xml:33: element Reference: validity error : No declaration
>> for attribute URI of element Reference
>> XMLSEC_TEST.xml:34: element Transforms: validity error : No declaration
>> for element Transforms
>> XMLSEC_TEST.xml:35: element Transform: validity error : No declaration
>> for element Transform
>> XMLSEC_TEST.xml:35: element Transform: validity error : No declaration
>> for attribute Algorithm of element Transform
>> XMLSEC_TEST.xml:37: element DigestMethod: validity error : No
>> declaration for element DigestMethod
>> XMLSEC_TEST.xml:37: element DigestMethod: validity error : No
>> declaration for attribute Algorithm of element DigestMethod
>> XMLSEC_TEST.xml:38: element DigestValue: validity error : No declaration
>> for element DigestValue
>> XMLSEC_TEST.xml:40: element Reference: validity error : No declaration
>> for element Reference
>> XMLSEC_TEST.xml:40: element Reference: validity error : No declaration
>> for attribute URI of element Reference
>> XMLSEC_TEST.xml:41: element Transforms: validity error : No declaration
>> for element Transforms
>> XMLSEC_TEST.xml:42: element Transform: validity error : No declaration
>> for element Transform
>> XMLSEC_TEST.xml:42: element Transform: validity error : No declaration
>> for attribute Algorithm of element Transform
>> XMLSEC_TEST.xml:44: element DigestMethod: validity error : No
>> declaration for element DigestMethod
>> XMLSEC_TEST.xml:44: element DigestMethod: validity error : No
>> declaration for attribute Algorithm of element DigestMethod
>> XMLSEC_TEST.xml:45: element DigestValue: validity error : No declaration
>> for element DigestValue
>> XMLSEC_TEST.xml:47: element Reference: validity error : No declaration
>> for element Reference
>> XMLSEC_TEST.xml:47: element Reference: validity error : No declaration
>> for attribute URI of element Reference
>> XMLSEC_TEST.xml:48: element Transforms: validity error : No declaration
>> for element Transforms
>> XMLSEC_TEST.xml:49: element Transform: validity error : No declaration
>> for element Transform
>> XMLSEC_TEST.xml:49: element Transform: validity error : No declaration
>> for attribute Algorithm of element Transform
>> XMLSEC_TEST.xml:51: element DigestMethod: validity error : No
>> declaration for element DigestMethod
>> XMLSEC_TEST.xml:51: element DigestMethod: validity error : No
>> declaration for attribute Algorithm of element DigestMethod
>> XMLSEC_TEST.xml:52: element DigestValue: validity error : No declaration
>> for element DigestValue
>> XMLSEC_TEST.xml:54: element Reference: validity error : No declaration
>> for element Reference
>> XMLSEC_TEST.xml:54: element Reference: validity error : No declaration
>> for attribute URI of element Reference
>> XMLSEC_TEST.xml:55: element Transforms: validity error : No declaration
>> for element Transforms
>> XMLSEC_TEST.xml:56: element Transform: validity error : No declaration
>> for element Transform
>> XMLSEC_TEST.xml:56: element Transform: validity error : No declaration
>> for attribute Algorithm of element Transform
>> XMLSEC_TEST.xml:58: element DigestMethod: validity error : No
>> declaration for element DigestMethod
>> XMLSEC_TEST.xml:58: element DigestMethod: validity error : No
>> declaration for attribute Algorithm of element DigestMethod
>> XMLSEC_TEST.xml:59: element DigestValue: validity error : No declaration
>> for element DigestValue
>> XMLSEC_TEST.xml:61: element Reference: validity error : No declaration
>> for element Reference
>> XMLSEC_TEST.xml:61: element Reference: validity error : No declaration
>> for attribute URI of element Reference
>> XMLSEC_TEST.xml:62: element Transforms: validity error : No declaration
>> for element Transforms
>> XMLSEC_TEST.xml:63: element Transform: validity error : No declaration
>> for element Transform
>> XMLSEC_TEST.xml:63: element Transform: validity error : No declaration
>> for attribute Algorithm of element Transform
>> XMLSEC_TEST.xml:65: element DigestMethod: validity error : No
>> declaration for element DigestMethod
>> XMLSEC_TEST.xml:65: element DigestMethod: validity error : No
>> declaration for attribute Algorithm of element DigestMethod
>> XMLSEC_TEST.xml:66: element DigestValue: validity error : No declaration
>> for element DigestValue
>> XMLSEC_TEST.xml:69: element SignatureValue: validity error : No
>> declaration for element SignatureValue
>> XMLSEC_TEST.xml:70: element KeyInfo: validity error : No declaration for
>> element KeyInfo
>> XMLSEC_TEST.xml:71: element SecurityTokenReference: validity error : No
>> declaration for element SecurityTokenReference
>> XMLSEC_TEST.xml:72: element Reference: validity error : No declaration
>> for element Reference
>> XMLSEC_TEST.xml:72: element Reference: validity error : No declaration
>> for attribute URI of element Reference
>> XMLSEC_TEST.xml:72: element Reference: validity error : No declaration
>> for attribute ValueType of element Reference
>> XMLSEC_TEST.xml:78: element Body: validity error : No declaration for
>> element Body
>> XMLSEC_TEST.xml:78: element Body: validity error : No declaration for
>> attribute Id of element Body
>> XMLSEC_TEST.xml:79: element RequestSecurityToken: validity error : No
>> declaration for element RequestSecurityToken
>> XMLSEC_TEST.xml:79: element RequestSecurityToken: validity error : No
>> declaration for attribute xmlns:wst of element RequestSecurityToken
>> XMLSEC_TEST.xml:80: element TokenType: validity error : No declaration
>> for element TokenType
>> XMLSEC_TEST.xml:81: element RequestType: validity error : No declaration
>> for element RequestType
>> func=xmlSecXPathDataExecute:file=xpath.c:line=273:obj=unknown:subj=xmlXPtrEval:error=5:libxml2
>> library function
>> failed:expr=xpointer(id('pfxfeb1d38a-a5f3-aa5a-e735-eba9501d6554'))
>> func=xmlSecXPathDataListExecute:file=xpath.c:line=356:obj=unknown:subj=xmlSecXPathDataExecute:error=1:xmlsec
>> library function failed:
>> func=xmlSecTransformXPathExecute:file=xpath.c:line=466:obj=xpointer:subj=xmlSecXPathDataExecute:error=1:xmlsec
>> library function failed:
>> func=xmlSecTransformDefaultPushXml:file=transforms.c:line=2371:obj=xpointer:subj=xmlSecTransformExecute:error=1:xmlsec
>> library function failed:
>> func=xmlSecTransformCtxXmlExecute:file=transforms.c:line=1207:obj=unknown:subj=xmlSecTransformPushXml:error=1:xmlsec
>> library function failed:transform=xpointer
>> func=xmlSecTransformCtxExecute:file=transforms.c:line=1267:obj=unknown:subj=xmlSecTransformCtxXmlExecute:error=1:xmlsec
>> library function failed:
>> func=xmlSecDSigReferenceCtxProcessNode:file=xmldsig.c:line=1568:obj=unknown:subj=xmlSecTransformCtxExecute:error=1:xmlsec
>> library function failed:
>> func=xmlSecDSigCtxProcessSignedInfoNode:file=xmldsig.c:line=804:obj=unknown:subj=xmlSecDSigReferenceCtxProcessNode:error=1:xmlsec
>> library function failed:node=Reference
>> func=xmlSecDSigCtxProcessSignatureNode:file=xmldsig.c:line=547:obj=unknown:subj=xmlSecDSigCtxProcessSignedInfoNode:error=1:xmlsec
>> library function failed:
>> func=xmlSecDSigCtxSign:file=xmldsig.c:line=303:obj=unknown:subj=xmlSecDSigCtxSigantureProcessNode:error=1:xmlsec
>> library function failed:
>> Error: signature failed
>> Error: failed to sign file "XMLSEC_TEST.xml"
>>
>>
>>
>> _______________________________________________
>> xmlsec mailing list
>> xmlsec at aleksey.com
>> http://www.aleksey.com/mailman/listinfo/xmlsec
>
>




More information about the xmlsec mailing list