[xmlsec] Using XPath

Gregor Ibic gregor.ibic@intelicom.si
Fri, 1 Nov 2002 19:11:40 +0100


Nope. I get syntac error. I tried also this. Its in Delphi but uses the same
libxml.

    (doc.documentElement As IDomNodeSelect).registerNs('dsig',
'http://www.w3.org/2000/09/xmldsig#');
    bodyNodes := (doc.documentElement As IDomNodeSelect).selectNodes(
                  'ancestor-or-self::dsig://Signature'
                    );

or with

ancestor-or-self::/Request/dsig:Signature

XML is now:

<?xml version="1.0" encoding="UTF-8" ?>
<Request>
  <DataObject Id="object">abc¹d</DataObject>
  <Signature xmlns:dsig="http://www.w3.org/2000/09/xmldsig#">
    <SignedInfo>
      <CanonicalizationMethod
Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315" />
      <SignatureMethod
Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1" />
      <Reference URI="#object">
        <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
        <DigestValue></DigestValue>
      </Reference>
    </SignedInfo>
  <SignatureValue>
  </SignatureValue>
  <KeyInfo>
    <KeyName></KeyName>
  </KeyInfo>
  </Signature>
</Request>

Uh, Im really tired of experimenting.
Is there any good source of examples beside the w3c standards?

Regards,
Gregor