AuthorDocumentController findNodesByXpath not returning expected values
Posted: Mon Jul 16, 2012 11:13 am
I'm writing some code to find all <para/> nodes within a <paragraph/> node. However I'm retrieving all para nodes within the entire document.
I'm using the following code
However using the the console output I'm getting the following. The paragraph I'm using for the relative path is
However I'm getting the following para nodes returned.
I only expected "<para> (24, 40)" to be returned.
I'm using the following code
Code: Select all
final AuthorNode node = access.getDocumentController().getNodeAtOffset(offset);
final AuthorNode paragraphNode = DocumentUtils.getParagraphNode(node);
final AuthorNode[] paraNodes = access.getDocumentController().findNodesByXPath("//para", paragraphNode, true, true, true, true);
Code: Select all
<paragraph> (23, 41)
Code: Select all
[<para> (24, 40), <para> (45, 61), <para> (66, 88), <para> (89, 111), <para> (116, 138), <para> (139, 161), <para> (166, 188), <para> (189, 211), <para> (216, 238), <para> (239, 261), <para> (266, 288), <para> (289, 311), <para> (316, 332), <para> (345, 361), <para> (406, 422), <para> (446, 462), <para> (495, 511), <para> (528, 544), <para> (571, 587), <para> (592, 608)]