commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "David Leangen" <david.lean...@konova.com>
Subject [JXPath and Ant] Using JXPath as an Ant task
Date Sun, 11 May 2003 09:00:03 GMT

Hello!

I would really like to use JXPath as an Ant task.

After having looked around all day for any documentation I could find, I
have set things up in the following way:

First, I set my classpath:

    <path id="jar.path">
      <fileset dir="${project.home}/lib">
        <include name="**/*.jar"/>
      </fileset>
    </path>
    <pathconvert property="jar.classpath" refid="jar.path"
targetos="windows"/>

"${project.home}/lib" contains commons-jxpath.jar and ant-sax2.jar, among
others.


Next, I declared my taskdef:

    <taskdef name="jxpath"
classname="org.apache.tools.ant.taskdefs.optional.JXPath"
classpath="${jar.classpath}"/>

As far as I know, I need to "initiate" jxpath with this tag:

    <jxpath/>

So, now I try to to reference something... anything, but all I get is the
verbatim text. For example, when I try:

    <echo message="${jxpath:/references}"/>

or

    <echo message="${jxpath:/references/build.xml/root/project/@name}"/>

All I get echoed back is:

    ${jxpath:/references}
    ${jxpath:/references/build.xml/root/project/@name}

Anybody have any idea of what I'm doing wrong?


Thanks!


Dave



Mime
View raw message