[xmlsec] troubles with xpath transforms

Hårek Ryeng haarek.ryeng at welldiagnostics.com
Thu Jul 17 02:29:26 PDT 2003


Hi Aleksey!
 
I’m using xmlsec 1.0.2.
 
The transform I’m trying to add to my envelope uri reference element
(uri=””) is:
 
<ds:XPath xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
                        not(
 
ancestor-or-self::node()[@SOAP-ENV:actor="urn:oasis:names:tc:ebxml-msg:a
ctor:nextMSH"] | 
 
ancestor-or-self::node()[@SOAP-ENV:actor="http://schemas.xmlsoap.org/soa
p/actor/next"]
                           )
</ds:XPath>
 
However I’m unable to make it work in xmlsec

 
There seems to be two problems:
1) Quotation marks are not included in the resulting XPATH element.
 
2) More than one namespace in an attribute doesn’t work (probably caused
by me messing with the quotation marks).
This works: string xpathExpression =
"not(ancestor-or-self::node()[@SOAP-ENV:actor=””urn:ebxml-msg””])"; 
This don’t:  string xpathExpression =
"not(ancestor-or-self::node()[@SOAP-ENV:actor=””urn:oasis:ebxml-msg””])"
;
 
Since I’m new to xpath transforms it might be some minor syntactical
problems

 
Any tips?
 
 
Fyi: my code is below:
---------------------------------------------------
 
string xpathExpression =
"not(ancestor-or-self::node()[@SOAP-ENV:actor=””urn:oasis:ebxml-msg””])"
; // partial expression test
 
xmlNodePtr transformNode =
xmlSecTmplReferenceAddTransform(referenceNode, xmlSecTransformXPathId);
if(transformNode == NULL) 
{
            m_lastError = "Failed to add XPath transform";
            return(NULL);
}
 
if (xmlSecTmplTransformAddXPath(transformNode, 
 (const unsigned char*)xpathExpression.c_str(),
             NULL) != 0)
{
m_lastError = "Failed to add XPath expression";
            return(NULL);
}
 
 
 
W | Hårek Ryeng, Senior System Developer
E | Well Diagnostics AS, Forskningsparken, 9291 Tromsø
L | Tel: +47 77 75 76 79 (70), Cell: +47 970 05 022, Fax: +47 77 75 76
99
L |  <http://www.welldiagnostics.com/> http://www.welldiagnostics.com/
<http://www.welldiagnostics.com/> 
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.aleksey.com/pipermail/xmlsec/attachments/20030717/358ffbbd/attachment.htm


More information about the xmlsec mailing list