REXML and XPath

Hi,

i want to select the <ds:Signature> element in the following xml document (shortend):

<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" ...
    <env:Header>
       <wsse:Security env:mustUnderstand="1" ...
          <wsse:BinarySecurityToken ...
          <ds:Signature xmlns:ds="http://www.w3.org/2000/09/xmldsig ...
          <ds:SignedInfo> ...

I have tried various approachs with REXML and XPATH like

e=XPath.match(doc, "/env:Envelope/env:Header/wsse:Security/ds:Signature")

but it returns only an empty array.

e=XPath.match(doc, "/env:Envelope/env:Header/wsse:Security")

returns the <wsse:Security> element as expected.

Any hints?

Regards,

Roland

Roland Schmitt wrote:

I have tried various approachs with REXML and XPATH like

e=XPath.match(doc, "/env:Envelope/env:Header/wsse:Security/ds:Signature")

XPath.first() ?

···

--
  Phlip
  http://industrialxp.org/community/bin/view/Main/TestFirstUserInterfaces

Hi Roland.

I've spent some time with Rexml.

The preface is that the Rexml tut page is feature packed.
http://www.germane-software.com/software/rexml/docs/tutorial.html

Most questions you will come across in your first months are answered
on this page. Amazingly.

Second tip is to make the xml 'doc' a 'Rexml doc' before you try any
Rex actions.

Nod to T-Rex soft tissue .... 'what could go wrong?'.

Markt

···

On Sun, 27 Mar 2005 04:29:56 +0900, Roland Schmitt <Roland.Schmitt@web.de> wrote:

Hi,

i want to select the <ds:Signature> element in the following xml
document (shortend):

<env:Envelope xmlns:env="Error; ...
    <env:Header>
       <wsse:Security env:mustUnderstand="1" ...
          <wsse:BinarySecurityToken ...
          <ds:Signature xmlns:ds="XML-Signature Syntax and Processing ...
          <ds:SignedInfo> ...

I have tried various approachs with REXML and XPATH like

e=XPath.match(doc, "/env:Envelope/env:Header/wsse:Security/ds:Signature")

but it returns only an empty array.

e=XPath.match(doc, "/env:Envelope/env:Header/wsse:Security")

returns the <wsse:Security> element as expected.

Any hints?

Regards,

Roland