synapse-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bill Harts <>
Subject XPath doesn't return attribute value
Date Wed, 10 Jun 2009 11:40:56 GMT
 Hi all:

Since I'm new to Synapse and Axis2 I apologize in advance if I have missed
something here and report something that isn't actually broken.

An XPath expression in my synapse.xml configuration file is unable to
retrieve an XML attribute from a message.  Example:

<log level="custom">
  <property name="sessID"
xmlns:cfl="" />

The message body is:
  <cfl:LoginResponse xmlns:cfl="">
   <cfl:LoginResponseData sessionID="250446AD43C0EEF3ED2F3172F8FA0A3D"

In this case the log mediator always returns null for the sessID variable.

After poking around in a bunch of modules I believe that these XPath
expressions are being handled in module  Specifically
there is a call in stringValueOf(MessageContext synCtx) to
BaseXPath.evaluate() which returns a List of element pointers retrieved by
the XPath expression.  The function then correctly checks each element to to
determine if it is of type OMTextImpl, OMElementImpl or OMDocumentImpl but
when an attribute has been found evaluate() returns an attribute of type
DocumentNavigator$OMAttributeEx.  It appears that there is no code in
stringValueOf() to handle this type of pointer.

I added the following code to at line 206:

                    } else if (o instanceof OMAttributeEx) {

Also, since the type OMAttributeEx is an inner class of type
DocumentNavigator I needed to add an import statement in


Unfortunately, OMAtributeEx is defined as private to class DocumentNavigator
so I had to declare class and constructor OMAttributeEx as public in the
module in the Axiom project module axiom-api.jar.

If someone can point me to instructions for how to create a patch I will
post one here.


View raw message