Skip to main content
1-Visitor
Dec 18, 2015 4:24 PM UTC
Solved

Can I get children of current node by xpath

I'm trying to get children of current node by using xpath in APP source edit mode!

Can it be done in this way?

    16-Pearl
    Dec 18, 2015 10:38 PM UTC

    APP source edit mode = APP Javascript FOM

    The way to access the current node during formatting is: formatting.currentXMLNode

    Once you have an XML Node object you can run XPath against it: myNode.evaluateXPath("something")

    To access child elements in XPath: child::*

    So putting it all together: formatting.currentXMLNode.evaluateXPath("child::*")

    3 replies

    1-Visitor
    Dec 18, 2015 5:16 PM UTC

    I'm not sure what APP source edit mode is, but there is an acl function:  oid_xpath_nodeset_str(srcOid, xpath)

    I use this in conjunction with a helper acl method to make calls from java.

    See the archive at:  aclxpathhelperfunction - www2

    Translate
    16-Pearl
    Dec 18, 2015 10:38 PM UTC

    APP source edit mode = APP Javascript FOM

    The way to access the current node during formatting is: formatting.currentXMLNode

    Once you have an XML Node object you can run XPath against it: myNode.evaluateXPath("something")

    To access child elements in XPath: child::*

    So putting it all together: formatting.currentXMLNode.evaluateXPath("child::*")

    Translate
    5-Regular Member
    Jan 21, 2016 4:26 PM UTC

    Hey dr bd,

    Did Gareth's reply help you out?

    Let us know if you got it resolved, or need more assistance.  Thanks!

    Translate