Avatar

Correct answer by
Community Advisor

Hi,

 

Doc link isn't accurate here- XML objects in workflows don't have getValue().

 

Here are e4x equivalents for xpaths though, from https://svn.wso2.org/repos/wso2/tags/carbon/0.1alpha/mashup/java/xdocs/e4xquickstart.html:

XPathMeaningE4X Equivalent

element/*

Select all children of element

element.*

element/@*

Select all attributes of element

element.@*

element//descendent

Select all descendents (children, grandchildren, etc.) of element

element..descendent

.. or parent::element

Select the parent of element

element.parent()

xmlns:foo="..."

element/foo:bar

Select the foo:bar child of element where foo is the prefix of a declared namespace

var foo = new Namespace(...);

element.foo::bar

name(element)

Return the full name (including prefix if any) of element

element.name()

local-name(element)

Return the local name of element

element.localName()

namespace-uri(element)

Return the namespace uri (if any) of element

element.namespace()

element/namespace::*

Return the collection of namespaces as an Array of Namespace objects (E4X) or a nodeset of Namespaces nodes (XPath)

element.inScopeNamespaces()

element/processing-instructions(name)

Return the processing instruction children of element with the specified name (if omitted, all are returned).

element.processingInstructions(name)

string(element)

Return the concatenated text nodes of this element and all its descendants

stringValue(element);

stringValue.visible = false;
function stringValue(node) {
    var value = "";
    if (node.hasSimpleContent()) {
        value = node.toString();
    } else {
        for each (var c in node.children()) {
            value += stringValue(c);
        }
    }
    return value;
}

 

xml.getValue("//@count") -> xml..@count 

 

Thanks,

-Jon

View solution in original post