Java

NAVIGATION
CATEGORIES
REFERRENCE
LINKS
  • Custom XPath functions

    3 answers - 1106 bytes - related search similar search Add To My Delicious Add To My Stumble Upon Add To My Google Mark Add To My Facebook Add To My Digg Add To My Reddit

    Hello,
    I'm planning to start a project that should use XM to process XML. However
    a must use customized XPath functions in this project.
    I've searched for some information about custom XPath functions in XM and
    didn't find anything. Since XM uses Jaxen for XPath processing, I looked
    into adding custom functions to it and actually is quite easy to do so
    (simply by getting the org.jaxen.XPathFunctionContext used and registering a
    new Function on it).
    However, the JaxenConnector class instead of using a singleton
    XPathFunctionContext - that could be provided through
    () and be able to be obtained the same
    instance all over the code in order to customize it -, it creates a new one,
    what makes more difficult for customization.
    So, my question is: Is there any reason to create a new XPathFunctionContext
    in JaxenConnector or I can modify it in order to use the singleton pattern
    without any side-effects?
    Thank you,
    Guilherme
    XM-interest mailing list
    XM-interest (AT) lists (DOT) ibiblio.org
  • No.1 | | 659 bytes | |

    Guilherme Germoglio wrote:
    Hello,

    I'm planning to start a project that should use XM to process XML. However
    a must use customized XPath functions in this project.

    You can't add custom functions directly to the version of Jaxen bundled
    with XM. You could do this by using Jaxen directly, though the
    navigator there is a little different and a little buggy.

    If you had a good use case, you might convince me to expose more of
    jaxen in XM or improve the jaxen navigator. However, my general
    assumption is that non-XPathish things can usually be done more easily
    in straight Java than in an extension function.
  • No.2 | | 518 bytes | |

    16/09/06, Elliotte Harold <elharo (AT) metalab (DOT) unc.eduwrote:

    If you had a good use case, you might convince me to expose more of
    jaxen in XM or improve the jaxen navigator. However, my general
    assumption is that non-XPathish things can usually be done more easily
    in straight Java than in an extension function.

    you mean, we should move out of the XML space into java-land ?

    :)
    -steve

    XM-interest mailing list
    XM-interest (AT) lists (DOT) ibiblio.org
  • No.3 | | 159 bytes | |

    Steve Loughran wrote:
    you mean, we should move out of the XML space into java-land ?
    Exactly. XPath isn't Turning complete for a reason. :-)

Re: Custom XPath functions


max 4000 letters.
Your nickname that display:
In order to stop the spam: 7 + 6 =
QUESTION ON "Java"

EMSDN.COM