<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.2900.2523" name=GENERATOR></HEAD>
<BODY>
<DIV dir=ltr align=left><SPAN class=260261920-02092005><FONT face=Arial
color=#0000ff size=2>Well, as usual, I'll answer my own question.
</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=260261920-02092005><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=260261920-02092005><FONT face=Arial
color=#0000ff size=2>Seems that XPath can't handle namespace prefixes all
by its lonesome. If you have an expression that has namespace prefixes, you have
to indicate the namespaces in the XPath object. Like so:</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=260261920-02092005><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=260261920-02092005><FONT face=Arial
color=#0000ff size=2> XPath
conditionXpath = XPath.newInstance("<FONT
color=#000000>//ruleDef/ilog:conditions[1]/text<STRONG>()</STRONG></FONT>");<BR>
conditionXpath.addNamespace("ilog", "<A
href="http://www.myrules.com/">http://www.myrules.com</A>");<BR></FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=260261920-02092005><FONT face=Arial
color=#0000ff size=2>-Kevin</DIV></FONT></SPAN><BR>
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B> jdom-interest-bounces@jdom.org
[mailto:jdom-interest-bounces@jdom.org] <B>On Behalf Of </B>Kevin L.
Cobb<BR><B>Sent:</B> Friday, September 02, 2005 2:05 PM<BR><B>To:</B>
jdom-interest@jdom.org<BR><B>Subject:</B> [jdom-interest] XPATH and
namespace<BR></FONT><BR></DIV>
<DIV></DIV>
<DIV><FONT face=Arial size=2><SPAN class=417315817-02092005>Having trouble
getting an XPATH expression with a namespace identifier to retreive the value in
the XPATH. Example:</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=417315817-02092005></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN
class=417315817-02092005></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=417315817-02092005><ruleDef
xmlns:ilog="<A
href="http://www.myrules.com">http://www.myrules.com</A>"><BR>
<ilog:conditions conditionId="condID_590"
ruleId="rule_590">3</ilog:conditions><BR> </ruleDef><BR></SPAN></FONT></DIV>
<DIV><SPAN class=417315817-02092005><FONT face=Arial size=2>The XPATH expression
"//ruleDef/ilog:conditions[1]/text<STRONG>()"</STRONG> does not return a result.
I expect 3 to be the result. </FONT></SPAN></DIV>
<DIV><SPAN class=417315817-02092005><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=417315817-02092005><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=417315817-02092005><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=417315817-02092005><FONT face=Arial
size=2>Thanks,</FONT></SPAN></DIV>
<DIV><SPAN class=417315817-02092005><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=417315817-02092005><FONT face=Arial
size=2>Kevin</FONT></SPAN></DIV>
<DIV><SPAN class=417315817-02092005><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=417315817-02092005><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<P style="MARGIN-BOTTOM: 0in"></P>
<DIV><FONT face=Arial size=2></FONT> </DIV></BODY></HTML>