[jdom-interest] XPath?

Frank Sauer Frank.Sauer at trcinc.com
Wed Sep 19 11:14:25 PDT 2001


I'm trying to use an XPath engine with JDOM to obtain the textual
content of the <name> element under the <tag> element in a taglib tld
file. I tried to use both werken.xpath and jaxen, but can't
get either to work. The context node is the <tag> element, so I tried
all of the following expressions:

name
name/text()
child::name
child::name/text()
/name
//name

and many others...... They all come up with no results...
no errors, just empty result sets. I tried JDOM b6 and b7 (as supplied with
Jaxen)
I must be missing something here. Here's a piece of the XML file:

<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE taglib PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag Library
1.1//EN" "http://java.sun.com/j2ee/dtds/web-jsptaglibrary_1_1.dtd">

<taglib>
<tlibversion>1.3</tlibversion>
<jspversion>1.1</jspversion>
<shortname>FileTags</shortname>
<uri>http://www.servletsuite.com/servlets/filetags</uri>
<info>File manipulation tags</info>

<tag>

<name>copyFile</name>
<tagclass>com.cj.ftag.copyFile</tagclass>
<bodycontent>empty</bodycontent>
<info>copy file</info>

<attribute>
<name>source</name>
<required>true</required>
<rtexprvalue>true</rtexprvalue>
</attribute>

<attribute>
<name>target</name>
<required>true</required>
<rtexprvalue>true</rtexprvalue>
</attribute>

</tag>

Any clues???

Frank Sauer
The Technical Resource Connection, Inc.
a wholly owned subsidiary of Perot Systems
Tampa, FL
http://www.trcinc.com
-----------------------------------------------
Java: The best argument for Smalltalk since C++



More information about the jdom-interest mailing list