From 342658a132dddc6f2d72f83070e55a545a5c1608 Mon Sep 17 00:00:00 2001 From: Nick Wellnhofer Date: Sun, 8 Mar 2015 16:46:04 +0100 Subject: Add a couple of XPath tests --- result/XPath/tests/simplebase | 46 +++++++++++++++++++++++++++++++++++++++++++ test/XPath/tests/simplebase | 5 +++++ 2 files changed, 51 insertions(+) diff --git a/result/XPath/tests/simplebase b/result/XPath/tests/simplebase index 980d18ef..3c32d17e 100644 --- a/result/XPath/tests/simplebase +++ b/result/XPath/tests/simplebase @@ -59,6 +59,19 @@ Set contains 3 nodes: 3 TEXT content= +======================== +Expression: /child::EXAMPLE/attribute::prop1/self::node() +Object is a Node Set : +Set contains 1 nodes: +1 ATTRIBUTE prop1 + TEXT + content=gnome is great + +======================== +Expression: /child::EXAMPLE/attribute::prop1/self::* +Object is a Node Set : +Set contains 0 nodes: + ======================== Expression: /child::EXAMPLE/attribute::prop1/descendant-or-self::node() Object is a Node Set : @@ -67,6 +80,39 @@ Set contains 1 nodes: TEXT content=gnome is great +======================== +Expression: /child::EXAMPLE/attribute::prop1/descendant-or-self::* +Object is a Node Set : +Set contains 0 nodes: + +======================== +Expression: /child::EXAMPLE/attribute::prop1/ancestor-or-self::node() +Object is a Node Set : +Set contains 3 nodes: +1 / +2 ELEMENT EXAMPLE + ATTRIBUTE prop1 + TEXT + content=gnome is great + ATTRIBUTE prop2 + TEXT + content=& linux too +3 ATTRIBUTE prop1 + TEXT + content=gnome is great + +======================== +Expression: /child::EXAMPLE/attribute::prop1/ancestor-or-self::* +Object is a Node Set : +Set contains 1 nodes: +1 ELEMENT EXAMPLE + ATTRIBUTE prop1 + TEXT + content=gnome is great + ATTRIBUTE prop2 + TEXT + content=& linux too + ======================== Expression: /descendant::title Object is a Node Set : diff --git a/test/XPath/tests/simplebase b/test/XPath/tests/simplebase index 9a1476e6..8b2c7d15 100644 --- a/test/XPath/tests/simplebase +++ b/test/XPath/tests/simplebase @@ -5,6 +5,11 @@ /child::EXAMPLE/child::head/child::title /child::EXAMPLE/child::head/child::title/child::text() /child::EXAMPLE/child::head/node() +/child::EXAMPLE/attribute::prop1/self::node() +/child::EXAMPLE/attribute::prop1/self::* /child::EXAMPLE/attribute::prop1/descendant-or-self::node() +/child::EXAMPLE/attribute::prop1/descendant-or-self::* +/child::EXAMPLE/attribute::prop1/ancestor-or-self::node() +/child::EXAMPLE/attribute::prop1/ancestor-or-self::* /descendant::title /descendant::p/ancestor::chapter -- cgit v1.2.3