I'm trying to understand exactly what line 785 does here:
however I can find no clear explanation of this in the docs e.g. here:
I.e. I can understand what targeting a single namespace ("ps") does, but what does the addition of the second namespace ("d") do?
Edit: follow up clarification: would a document starting with this be successfully parsed, given that the 'protocol' namespace is lower-case in the document but upper case in the code?
<samlp:Response xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol" Version="2.0" >
The response being queried via XPath uses two different namespaces,
p
namespace prefix is for SAML
Core (urn:oasis:names:tc:SAML:2.0:protocol
).ds
is for XML Signature
(http://www.w3.org/2000/09/xmldsig#
).and both are declared to the XPath processor via the argument to REXML::XPath.match
on the cited line in the code:
{ "p" => PROTOCOL, "ds" => DSIG },
The namespace prefix (p
) is arbitrary and need not match the one used in the document. The namespace (urn:oasis:names:tc:SAML:2.0:protocol
) is what's important and must match the one used in the document. Both are case-sensitive.