summaryrefslogtreecommitdiffstats
path: root/libxml2/test/XPath
diff options
context:
space:
mode:
authorWilliam Joye <wjoye@cfa.harvard.edu>2016-10-19 18:22:05 (GMT)
committerWilliam Joye <wjoye@cfa.harvard.edu>2016-10-19 18:22:05 (GMT)
commit34be72f9ed749a5c013d3f7f47d810e8caf652cb (patch)
tree2f75b6050c088da53d774b3da3fb71e7fa49ec78 /libxml2/test/XPath
parent604eac5688c5d437ed6d585ee63e53fba6f558c0 (diff)
parent0f851b6f17365c29b56d6a17564d58a33120508a (diff)
downloadblt-34be72f9ed749a5c013d3f7f47d810e8caf652cb.zip
blt-34be72f9ed749a5c013d3f7f47d810e8caf652cb.tar.gz
blt-34be72f9ed749a5c013d3f7f47d810e8caf652cb.tar.bz2
Merge commit '0f851b6f17365c29b56d6a17564d58a33120508a' as 'libxml2'
Diffstat (limited to 'libxml2/test/XPath')
-rw-r--r--libxml2/test/XPath/docs/chapters28
-rw-r--r--libxml2/test/XPath/docs/id28
-rw-r--r--libxml2/test/XPath/docs/lang13
-rw-r--r--libxml2/test/XPath/docs/mixed10
-rw-r--r--libxml2/test/XPath/docs/nodes2
-rw-r--r--libxml2/test/XPath/docs/ns3
-rw-r--r--libxml2/test/XPath/docs/simple12
-rw-r--r--libxml2/test/XPath/docs/str9
-rw-r--r--libxml2/test/XPath/docs/usr112
-rw-r--r--libxml2/test/XPath/docs/vid43
-rw-r--r--libxml2/test/XPath/expr/base7
-rw-r--r--libxml2/test/XPath/expr/compare46
-rw-r--r--libxml2/test/XPath/expr/equality26
-rw-r--r--libxml2/test/XPath/expr/floats61
-rw-r--r--libxml2/test/XPath/expr/functions25
-rw-r--r--libxml2/test/XPath/expr/strings34
-rw-r--r--libxml2/test/XPath/tests/chaptersbase10
-rw-r--r--libxml2/test/XPath/tests/chaptersprefol8
-rw-r--r--libxml2/test/XPath/tests/idsimple3
-rw-r--r--libxml2/test/XPath/tests/langsimple5
-rw-r--r--libxml2/test/XPath/tests/mixedpat7
-rw-r--r--libxml2/test/XPath/tests/nodespat5
-rw-r--r--libxml2/test/XPath/tests/nssimple3
-rw-r--r--libxml2/test/XPath/tests/simpleabbr10
-rw-r--r--libxml2/test/XPath/tests/simplebase15
-rw-r--r--libxml2/test/XPath/tests/usr1check1
-rw-r--r--libxml2/test/XPath/tests/vidbase5
-rw-r--r--libxml2/test/XPath/xptr/chapterschildseq8
-rw-r--r--libxml2/test/XPath/xptr/chaptersparts6
-rw-r--r--libxml2/test/XPath/xptr/chaptersrange4
-rw-r--r--libxml2/test/XPath/xptr/strpoint9
-rw-r--r--libxml2/test/XPath/xptr/strrange6
-rw-r--r--libxml2/test/XPath/xptr/strrange23
-rw-r--r--libxml2/test/XPath/xptr/strrange34
-rw-r--r--libxml2/test/XPath/xptr/vidbase2
-rw-r--r--libxml2/test/XPath/xptr/vidchildseq4
-rw-r--r--libxml2/test/XPath/xptr/vidparts3
37 files changed, 480 insertions, 0 deletions
diff --git a/libxml2/test/XPath/docs/chapters b/libxml2/test/XPath/docs/chapters
new file mode 100644
index 0000000..c48f65e
--- /dev/null
+++ b/libxml2/test/XPath/docs/chapters
@@ -0,0 +1,28 @@
+<?xml version="1.0"?>
+<EXAMPLE prop1="gnome is great" prop2="&amp; linux too">
+ <head>
+ <title>Welcome to Gnome</title>
+ </head>
+ <chapter id="chapter1">
+ <title>The Linux adventure</title>
+ <p>bla bla bla ...</p>
+ <image href="linus.gif"/>
+ <p>...</p>
+ </chapter>
+ <chapter id="chapter2">
+ <title>Chapter 2</title>
+ <p>this is chapter 2 ...</p>
+ </chapter>
+ <chapter id="chapter3">
+ <title>Chapter 3</title>
+ <p>this is chapter 3 ...</p>
+ </chapter>
+ <chapter id="chapter4">
+ <title>Chapter 4</title>
+ <p>this is chapter 4 ...</p>
+ </chapter>
+ <chapter id="chapter5">
+ <title>Chapter 5</title>
+ <p>this is chapter 5 ...</p>
+ </chapter>
+</EXAMPLE>
diff --git a/libxml2/test/XPath/docs/id b/libxml2/test/XPath/docs/id
new file mode 100644
index 0000000..4b6659f
--- /dev/null
+++ b/libxml2/test/XPath/docs/id
@@ -0,0 +1,28 @@
+<?xml version="1.0"?>
+<EXAMPLE id="root" prop1="gnome is great" prop2="&amp; linux too">
+ <head id="head">
+ <title>Welcome to Gnome</title>
+ </head>
+ <chapter id="chapter1">
+ <title>The Linux adventure</title>
+ <p>bla bla bla ...</p>
+ <image href="linus.gif"/>
+ <p>...</p>
+ </chapter>
+ <chapter id="chapter2">
+ <title>Chapter 2</title>
+ <p>this is chapter 2 ...</p>
+ </chapter>
+ <chapter id="chapter3">
+ <title>Chapter 3</title>
+ <p>this is chapter 3 ...</p>
+ </chapter>
+ <chapter id="chapter4">
+ <title>Chapter 4</title>
+ <p>this is chapter 4 ...</p>
+ </chapter>
+ <chapter id="chapter5">
+ <title>Chapter 5</title>
+ <p>this is chapter 5 ...</p>
+ </chapter>
+</EXAMPLE>
diff --git a/libxml2/test/XPath/docs/lang b/libxml2/test/XPath/docs/lang
new file mode 100644
index 0000000..abfe1d6
--- /dev/null
+++ b/libxml2/test/XPath/docs/lang
@@ -0,0 +1,13 @@
+<doc>
+ <x>1</x>
+ <b xml:lang="en">
+ <x>en</x>
+ <x>3</x>
+ </b>
+ <x>4</x>
+ <para xml:lang="en"/>
+ <div xml:lang="en"><para/></div>
+ <para xml:lang="EN"/>
+ <para xml:lang="en-us"/>
+ <para xml:lang="EN-US"/>
+</doc>
diff --git a/libxml2/test/XPath/docs/mixed b/libxml2/test/XPath/docs/mixed
new file mode 100644
index 0000000..3b457bc
--- /dev/null
+++ b/libxml2/test/XPath/docs/mixed
@@ -0,0 +1,10 @@
+<?xml version="1.0"?>
+<root>
+ <s p="root"/>
+ <p1>
+ <s p="p1"/>
+ </p1>
+ <p2>
+ <s p="p2"/>
+ </p2>
+</root>
diff --git a/libxml2/test/XPath/docs/nodes b/libxml2/test/XPath/docs/nodes
new file mode 100644
index 0000000..a863df0
--- /dev/null
+++ b/libxml2/test/XPath/docs/nodes
@@ -0,0 +1,2 @@
+<?xml version="1.0"?>
+<root><foo>txt<!--hello--><![CDATA[data]]><?target data?><bar>txt<!--hello--><![CDATA[data]]><?target data?></bar></foo></root> \ No newline at end of file
diff --git a/libxml2/test/XPath/docs/ns b/libxml2/test/XPath/docs/ns
new file mode 100644
index 0000000..88f4575
--- /dev/null
+++ b/libxml2/test/XPath/docs/ns
@@ -0,0 +1,3 @@
+<doc xmlns:ns1="nsuri1">
+ <elem xmlns:ns2="nsuri2"/>
+</doc>
diff --git a/libxml2/test/XPath/docs/simple b/libxml2/test/XPath/docs/simple
new file mode 100644
index 0000000..ca665a2
--- /dev/null
+++ b/libxml2/test/XPath/docs/simple
@@ -0,0 +1,12 @@
+<?xml version="1.0"?>
+<EXAMPLE prop1="gnome is great" prop2="&amp; linux too">
+ <head>
+ <title>Welcome to Gnome</title>
+ </head>
+ <chapter>
+ <title>The Linux adventure</title>
+ <p>bla bla bla ...</p>
+ <image href="linus.gif"/>
+ <p>...</p>
+ </chapter>
+</EXAMPLE>
diff --git a/libxml2/test/XPath/docs/str b/libxml2/test/XPath/docs/str
new file mode 100644
index 0000000..547e54d
--- /dev/null
+++ b/libxml2/test/XPath/docs/str
@@ -0,0 +1,9 @@
+<?xml version="1.0"?>
+<chapter>
+ <p>a simple test</p>
+ <p>multiple tests</p>
+ <p>a diff<em>i</em>cult one</p>
+ <p><p>a span</p>n<p>ing one</p></p>
+ <p><p>and an unbal</p><empty/>anced test</p>
+ <p>for empty string <seq>123</seq></p>
+</chapter>
diff --git a/libxml2/test/XPath/docs/usr1 b/libxml2/test/XPath/docs/usr1
new file mode 100644
index 0000000..44c7529
--- /dev/null
+++ b/libxml2/test/XPath/docs/usr1
@@ -0,0 +1,12 @@
+<?xml version="1.0"?>
+<BODY>
+<DECLARACION importador="123456789" fecha="08/09/2000"
+monto_factura="100.09">
+<ITEM monto="50.12" divisa="DOL">
+<SUFIJO codigo="NL34" valor="negro"/>
+<SUFIJO codigo="AS34" valor="grande"/>
+</ITEM>
+</DECLARACION>
+<FIRMA>N</FIRMA>
+</BODY>
+
diff --git a/libxml2/test/XPath/docs/vid b/libxml2/test/XPath/docs/vid
new file mode 100644
index 0000000..cdb7437
--- /dev/null
+++ b/libxml2/test/XPath/docs/vid
@@ -0,0 +1,43 @@
+<?xml version="1.0"?>
+<!DOCTYPE iddemo [
+<!ELEMENT iddemo (head?, (chapter)*)>
+<!ATTLIST iddemo id ID #IMPLIED>
+<!ELEMENT head (title?, (p)*)>
+<!ATTLIST head id ID #IMPLIED>
+<!ELEMENT chapter (title?, (p | image)*)>
+<!ATTLIST chapter id ID #IMPLIED>
+<!ELEMENT image EMPTY>
+<!ATTLIST image href CDATA #IMPLIED>
+<!ELEMENT title (#PCDATA)>
+<!ELEMENT p (#PCDATA)>
+]>
+
+<iddemo>
+ <head>
+ <title>Welcome to Gnome</title>
+ </head>
+ <chapter id="chapter1">
+ <title>The Linux adventure</title>
+ <p>bla bla bla ...</p>
+ <image href="linus.gif"/>
+ <p>...</p>
+ <p>third p</p>
+ <p>fourth p</p>
+ </chapter>
+ <chapter id="chapter2">
+ <title>Chapter 2</title>
+ <p>this is chapter 2 ...</p>
+ </chapter>
+ <chapter id="chapter3">
+ <title>Chapter 3</title>
+ <p>this is chapter 3 ...</p>
+ </chapter>
+ <chapter id="chapter4">
+ <title>Chapter 4</title>
+ <p>this is chapter 4 ...</p>
+ </chapter>
+ <chapter id="chapter5">
+ <title>Chapter 5</title>
+ <p>this is chapter 5 ...</p>
+ </chapter>
+</iddemo>
diff --git a/libxml2/test/XPath/expr/base b/libxml2/test/XPath/expr/base
new file mode 100644
index 0000000..f57e4d0
--- /dev/null
+++ b/libxml2/test/XPath/expr/base
@@ -0,0 +1,7 @@
+1
+1+2
+2*3
+1+2*3+4
+(1+2)*(3+4)
+1*1+1*1+1*1+1*1+1*1+1*1+1*1+1*1+1*1+1*1+1*1+1*1+1*1+1*1+1*1+1*1+1*1+1*1+1*1+1*1+1*1
+self::-name
diff --git a/libxml2/test/XPath/expr/compare b/libxml2/test/XPath/expr/compare
new file mode 100644
index 0000000..2d52eaf
--- /dev/null
+++ b/libxml2/test/XPath/expr/compare
@@ -0,0 +1,46 @@
+0<0
+0<=0
+0>0
+0>=0
+0<1
+0<=1
+0>1
+0>=1
+1<0
+1<=0
+1>0
+1>=0
+1<1
+1<=1
+1>1
+1>=1
+'0'<1
+'0'<=1
+'0'>1
+'0'>=1
+0<'1.2'
+0<='1.2'
+0>'1.2'
+0>='1.2'
+0<'-0.2'
+0<='-0.2'
+0>'-0.2'
+0>='-0.2'
+false()<1
+false()<=1
+0>true()
+0>=true()
+'a' > 'a'
+'a' > 'b'
+'b' > 'a'
+'a' < 'a'
+'a' < 'b'
+'b' < 'a'
+'a' >= 'a'
+'a' >= 'b'
+'b' >= 'a'
+'a' <= 'a'
+'a' <= 'b'
+'b' <= 'a'
+'a' > '0.0'
+'a' < '0.0'
diff --git a/libxml2/test/XPath/expr/equality b/libxml2/test/XPath/expr/equality
new file mode 100644
index 0000000..7982173
--- /dev/null
+++ b/libxml2/test/XPath/expr/equality
@@ -0,0 +1,26 @@
+1=1
+1!=1
+1=0
+1!=0
+true()=true()
+true()!=true()
+true()=false()
+false()!=true()
+'test'='test'
+'test'!='test'
+'test2'='test'
+'test2'!='test'
+false()=0
+false()!=0
+false()=1
+false()!=1
+0=true()
+0!=true()
+1=true()
+1!=true()
+true()='test'
+false()='test'
+'test'!=true()
+'test'!=false()
+'a'=0.0
+'a'!=0.0
diff --git a/libxml2/test/XPath/expr/floats b/libxml2/test/XPath/expr/floats
new file mode 100644
index 0000000..96c10d1
--- /dev/null
+++ b/libxml2/test/XPath/expr/floats
@@ -0,0 +1,61 @@
+1
+123
+1.23
+0.123
+4.
+.4
+1.23e3
+1.23e-3
+1 div 0
+-1 div 0
+0 div 0
+1 div -0
+(1 div 0) > 0
+(1 div 0) < 0
+(-1 div 0) > 0
+(-1 div 0) < 0
+(0 div 0) > 0
+(0 div 0) < 0
+(1 div -0) > 0
+(1 div -0) < 0
+0 div 0 = 0 div 0
+0 div 0 != 0 div 0
+0 div 0 > 0 div 0
+0 div 0 < 0 div 0
+0 div 0 >= 0 div 0
+0 div 0 <= 0 div 0
+1 div 0 = -1 div 0
+1 div 0 != -1 div 0
+1 div 0 > -1 div 0
+1 div 0 < -1 div 0
+1 div 0 >= -1 div 0
+1 div 0 <= -1 div 0
+1 div 0 = 1 div 0
+1 div 0 != 1 div 0
+1 div 0 > 1 div 0
+1 div 0 < 1 div 0
+1 div 0 >= -1 div 0
+1 div 0 <= -1 div 0
+-2 div 0 = -1 div 0
+1 div floor(0.1)
+1 div floor(-0.1)
+1 div floor(-0)
+1 div floor(0)
+1 div ceiling(0.1)
+1 div ceiling(-0.1)
+1 div ceiling(-0)
+1 div ceiling(0)
+1 div round(0.1)
+1 div round(-0.1)
+1 div round(-0)
+1 div round(0)
+1 div number('f')
+number('f') div 1
+1 div (1 div 0)
+(1 div 0) div 1
+-(1 div 0) div 1
+5 mod 2
+5 mod -2
+-5 mod 2
+-5 mod -2
+8 mod 3 = 2
diff --git a/libxml2/test/XPath/expr/functions b/libxml2/test/XPath/expr/functions
new file mode 100644
index 0000000..d168b18
--- /dev/null
+++ b/libxml2/test/XPath/expr/functions
@@ -0,0 +1,25 @@
+true()
+false()
+number("1.5")
+number('abc')
+-number('abc')
+floor(0.1)
+floor(-0.1)
+floor(-0)
+floor(0)
+floor(5.2)
+floor(-5.2)
+ceiling(0.1)
+ceiling(-0.1)
+ceiling(-0)
+ceiling(0)
+ceiling(5.2)
+ceiling(-5.2)
+round(0.1)
+round(5.2)
+round(5.5)
+round(5.6)
+round(-0.1)
+round(-5.2)
+round(-5.5)
+round(-5.6)
diff --git a/libxml2/test/XPath/expr/strings b/libxml2/test/XPath/expr/strings
new file mode 100644
index 0000000..849ca14
--- /dev/null
+++ b/libxml2/test/XPath/expr/strings
@@ -0,0 +1,34 @@
+string(5)
+string(0.5)
+string(-0.5)
+string(true())
+string(false())
+concat("titi","toto")
+concat("titi","toto","tata")
+concat("titi",'toto')
+concat("titi",'toto',"tata","last")
+starts-with("tititoto","titi")
+starts-with("tititoto","to")
+contains("tititototata","titi")
+contains("tititototata","toto")
+contains("tititototata","tata")
+contains("tititototata","tita")
+substring("12345",2,3)
+substring("12345",2)
+substring("12345",-4)
+substring("12345",3.4)
+substring("12345",3.6)
+substring("12345",1.5,2.6)
+substring("12345",2.2,2.2)
+substring("12345",0,3)
+substring("12345",-8,10)
+substring("12345",4,-10)
+substring("12345",0 div 0, 3)
+substring("12345",1, 0 div 0)
+substring("12345",1 div 0, 3)
+substring("12345",3,-1 div 0)
+substring("12345",-42, 1 div 0)
+substring("12345",-1 div 0, 1 div 0)
+substring("12345",-1 div 0,5)
+string-length("")
+string-length("titi")
diff --git a/libxml2/test/XPath/tests/chaptersbase b/libxml2/test/XPath/tests/chaptersbase
new file mode 100644
index 0000000..17638f7
--- /dev/null
+++ b/libxml2/test/XPath/tests/chaptersbase
@@ -0,0 +1,10 @@
+/child::EXAMPLE
+/child::*
+/child::EXAMPLE/child::head
+/child::EXAMPLE/child::*
+/child::EXAMPLE/child::head/child::title
+/child::EXAMPLE/child::head/child::title/child::text()
+/child::EXAMPLE/child::head/node()
+/descendant::title
+/descendant::p/ancestor::chapter
+//p[1]
diff --git a/libxml2/test/XPath/tests/chaptersprefol b/libxml2/test/XPath/tests/chaptersprefol
new file mode 100644
index 0000000..8f1e65b
--- /dev/null
+++ b/libxml2/test/XPath/tests/chaptersprefol
@@ -0,0 +1,8 @@
+/following::*
+/preceding::*
+/child::EXAMPLE/preceding::*
+/child::EXAMPLE/following::*
+/child::EXAMPLE/child::chapter[3]/preceding::*
+/child::EXAMPLE/child::chapter[3]/following::*
+/child::EXAMPLE/child::chapter[1]/image/preceding::*
+/child::EXAMPLE/child::chapter[1]/image/following::*
diff --git a/libxml2/test/XPath/tests/idsimple b/libxml2/test/XPath/tests/idsimple
new file mode 100644
index 0000000..2841ae9
--- /dev/null
+++ b/libxml2/test/XPath/tests/idsimple
@@ -0,0 +1,3 @@
+//*[@id="root"]
+//*[@id="chapter2"]
+//*[@id="chapter5"]
diff --git a/libxml2/test/XPath/tests/langsimple b/libxml2/test/XPath/tests/langsimple
new file mode 100644
index 0000000..f71a321
--- /dev/null
+++ b/libxml2/test/XPath/tests/langsimple
@@ -0,0 +1,5 @@
+//*[lang('en')]
+//*[lang('en-us')]
+//*[lang('en-gb')]
+//*[lang('fr')]
+//*[lang('')]
diff --git a/libxml2/test/XPath/tests/mixedpat b/libxml2/test/XPath/tests/mixedpat
new file mode 100644
index 0000000..c212f6c
--- /dev/null
+++ b/libxml2/test/XPath/tests/mixedpat
@@ -0,0 +1,7 @@
+s
+s|p1/s
+s|/root/p1/s
+/root/p1/s|s
+//s
+//s|p1
+p1|//s
diff --git a/libxml2/test/XPath/tests/nodespat b/libxml2/test/XPath/tests/nodespat
new file mode 100644
index 0000000..c157a3e
--- /dev/null
+++ b/libxml2/test/XPath/tests/nodespat
@@ -0,0 +1,5 @@
+/.
+//.
+/root//.
+//.//./././/.
+/root//././/bar//. \ No newline at end of file
diff --git a/libxml2/test/XPath/tests/nssimple b/libxml2/test/XPath/tests/nssimple
new file mode 100644
index 0000000..d2a9528
--- /dev/null
+++ b/libxml2/test/XPath/tests/nssimple
@@ -0,0 +1,3 @@
+/doc/elem/namespace::node()/..
+/doc/elem/namespace::*/self::node()[true()]
+//*[namespace::ns1]
diff --git a/libxml2/test/XPath/tests/simpleabbr b/libxml2/test/XPath/tests/simpleabbr
new file mode 100644
index 0000000..8de476f
--- /dev/null
+++ b/libxml2/test/XPath/tests/simpleabbr
@@ -0,0 +1,10 @@
+/EXAMPLE
+/EXAMPLE/head
+/EXAMPLE/chapter[1]
+//p
+//chapter/image
+//p/text()
+//p/text()[position()=1]
+//p/text()[position()=last()]
+(//p/text())[position()=1]
+(//p/text())[position()=last()]
diff --git a/libxml2/test/XPath/tests/simplebase b/libxml2/test/XPath/tests/simplebase
new file mode 100644
index 0000000..8b2c7d1
--- /dev/null
+++ b/libxml2/test/XPath/tests/simplebase
@@ -0,0 +1,15 @@
+/child::*
+/child::EXAMPLE
+/child::EXAMPLE/child::head
+/child::EXAMPLE/child::*
+/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
diff --git a/libxml2/test/XPath/tests/usr1check b/libxml2/test/XPath/tests/usr1check
new file mode 100644
index 0000000..c38d003
--- /dev/null
+++ b/libxml2/test/XPath/tests/usr1check
@@ -0,0 +1 @@
+//ITEM[1]
diff --git a/libxml2/test/XPath/tests/vidbase b/libxml2/test/XPath/tests/vidbase
new file mode 100644
index 0000000..5cd79ac
--- /dev/null
+++ b/libxml2/test/XPath/tests/vidbase
@@ -0,0 +1,5 @@
+id('chapter1')
+id('chapter3')
+id('chapter1')/p
+id('chapter1')//p
+id('chapter1')/p[1]
diff --git a/libxml2/test/XPath/xptr/chapterschildseq b/libxml2/test/XPath/xptr/chapterschildseq
new file mode 100644
index 0000000..3b52f5f
--- /dev/null
+++ b/libxml2/test/XPath/xptr/chapterschildseq
@@ -0,0 +1,8 @@
+/1/2/3
+element(/1/2/3)
+element(foo)element(/1/2/3)
+element(/1/2/3)element(foo)
+chapter1/3
+element(chapter1/3)
+element(foo)element(chapter1/3)
+element(chapter1/3)element(foo)
diff --git a/libxml2/test/XPath/xptr/chaptersparts b/libxml2/test/XPath/xptr/chaptersparts
new file mode 100644
index 0000000..aadc47c
--- /dev/null
+++ b/libxml2/test/XPath/xptr/chaptersparts
@@ -0,0 +1,6 @@
+xpointer(//chapitre[2])
+xpointer(//chapter[2])
+xpointer(//chapitre[2])xpointer(//chapter[2])
+xpointer(id("chapter1"))
+xpointer(//*[@id="chapter1"])
+xpointer(id("chapter1"))xpointer(//*[@id="chapter1"])
diff --git a/libxml2/test/XPath/xptr/chaptersrange b/libxml2/test/XPath/xptr/chaptersrange
new file mode 100644
index 0000000..4d7a55b
--- /dev/null
+++ b/libxml2/test/XPath/xptr/chaptersrange
@@ -0,0 +1,4 @@
+xpointer(//chapter[position() = 2]/range-to(following::chapter[1]))
+xpointer(//chapter[position() <= 2]/range-to(following::chapter[1]))
+xpointer(//chapter[position() = last()]/range-to(following::chapter[1]))
+xpointer(//chapter[position() = 3]/range-to(/.//chapter[position() = 1]))
diff --git a/libxml2/test/XPath/xptr/strpoint b/libxml2/test/XPath/xptr/strpoint
new file mode 100644
index 0000000..0916ef1
--- /dev/null
+++ b/libxml2/test/XPath/xptr/strpoint
@@ -0,0 +1,9 @@
+xpointer(start-point(string-range(//p,'multiple')))
+xpointer(end-point(string-range(//p,'multiple')))
+xpointer(start-point(string-range(//p,'test')))
+xpointer(end-point(string-range(//p,'test')))
+xpointer(start-point(string-range(//*,'multiple',1,0)))
+xpointer(end-point(string-range(//*,'multiple',1,0)))
+xpointer(start-point(string-range(//*,'multiple',1,1)))
+xpointer(end-point(string-range(//*,'multiple',1,1)))
+xpointer(start-point(string-range(//p,'test'))[1])
diff --git a/libxml2/test/XPath/xptr/strrange b/libxml2/test/XPath/xptr/strrange
new file mode 100644
index 0000000..3231927
--- /dev/null
+++ b/libxml2/test/XPath/xptr/strrange
@@ -0,0 +1,6 @@
+xpointer(string-range(//p, 'simple'))
+xpointer(string-range(//p, 'test'))
+xpointer(string-range(//p, 'difficult'))
+xpointer(string-range(//p, 'spanning'))
+xpointer(string-range(//p, 'unbalanced'))
+xpointer(string-range(//seq, ''))
diff --git a/libxml2/test/XPath/xptr/strrange2 b/libxml2/test/XPath/xptr/strrange2
new file mode 100644
index 0000000..5133547
--- /dev/null
+++ b/libxml2/test/XPath/xptr/strrange2
@@ -0,0 +1,3 @@
+xpointer(string-range(//p, 'test', 2))
+xpointer(string-range(//p, 'test', 2, 2))
+xpointer(string-range(//p, 'difficult', 1, 0))
diff --git a/libxml2/test/XPath/xptr/strrange3 b/libxml2/test/XPath/xptr/strrange3
new file mode 100644
index 0000000..aea5665
--- /dev/null
+++ b/libxml2/test/XPath/xptr/strrange3
@@ -0,0 +1,4 @@
+xpointer(string-range(//p, 'test', 1, 0))
+xpointer(string-range(//*, 'test', 1, 0))
+xpointer(string-range(//p, 'test', 1, 0)[2])
+xpointer(string-range(//*, 'test', 1, 0)[2])
diff --git a/libxml2/test/XPath/xptr/vidbase b/libxml2/test/XPath/xptr/vidbase
new file mode 100644
index 0000000..b146383
--- /dev/null
+++ b/libxml2/test/XPath/xptr/vidbase
@@ -0,0 +1,2 @@
+xpointer(id('chapter1')/p)
+xpointer(id('chapter1')/p[1]/range-to(following-sibling::p[2]))
diff --git a/libxml2/test/XPath/xptr/vidchildseq b/libxml2/test/XPath/xptr/vidchildseq
new file mode 100644
index 0000000..fe205dc
--- /dev/null
+++ b/libxml2/test/XPath/xptr/vidchildseq
@@ -0,0 +1,4 @@
+/1/2/3
+element(/1/2/3)
+chapter1/3
+element(chapter1/3)
diff --git a/libxml2/test/XPath/xptr/vidparts b/libxml2/test/XPath/xptr/vidparts
new file mode 100644
index 0000000..3afbbdd
--- /dev/null
+++ b/libxml2/test/XPath/xptr/vidparts
@@ -0,0 +1,3 @@
+xpointer(id("chapter1"))
+xpointer(//*[@id="chapter1"])
+xpointer(id("chapter1"))xpointer(//*[@id="chapter1"])