This worked with Xalan 2_2_D6 and hangs in 2_2_D9. The problem is centered
around the "branch[2]" part of the XPath expression. Seems that if the
number of branch elements in the test case is equal to or greater than the
XPath qualifier number, selectNodeList hangs. Otherwise it returns
correctly. For example, if I comment out the second branch element, it does
not hang and returns the NodeList.
-Mike
My sample xml file:
<?xml version="1.0" ?>
<a2wml version="2.0">
<card id="b">
<prompt>
this is a prompt
</prompt>
<branch target="#c" label="c"/>
<branch target="#f" type="options" label="f"/>
</card>
</a2wml>
My java code:
public static void main(String args[])
{
try
{
//parse test case
DocumentBuilderFactory dbf =
DocumentBuilderFactory.newInstance();
dbf.setValidating(false);
DocumentBuilder db = dbf.newDocumentBuilder();
InputSource in = new InputSource(new FileReader(args[0]));
Document doc = db.parse(in);
//make the card the context node
Node ctx = doc.getElementsByTagName("card").item(0);
NodeList nl = XPathAPI.selectNodeList (ctx, "prompt |
branch[2]");
System.out.println("nodelist.length:" + nl.getLength());
} catch (Exception e)
{
e.printStackTrace();
}
}