[libxml2]Add libxml2 library

This commit is contained in:
zhoujiale
2026-07-26 16:57:28 +08:00
committed by zhoujiale
parent 0a44ec8a06
commit e841ac915d
3790 changed files with 668244 additions and 0 deletions
+28
View File
@@ -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>
+28
View File
@@ -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>
+3
View File
@@ -0,0 +1,3 @@
<?xml version="1.0"?>
<rootB xmlns="abc://d/e:f">
</rootB>
+13
View File
@@ -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>
+10
View File
@@ -0,0 +1,10 @@
<?xml version="1.0"?>
<root>
<s p="root"/>
<p1>
<s p="p1"/>
</p1>
<p2>
<s p="p2"/>
</p2>
</root>
+2
View File
@@ -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>
+5
View File
@@ -0,0 +1,5 @@
<doc xmlns:ns1="nsuri1">
<preceding/>
<elem xmlns:ns2="nsuri2"/>
<following/>
</doc>
+12
View File
@@ -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>
+11
View File
@@ -0,0 +1,11 @@
<?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>
<p id="1">a<b>b</b>c</p>
<p id="2"><!--X-->abc</p>
</chapter>
+1
View File
@@ -0,0 +1 @@
<文書>text1</文書>
+12
View File
@@ -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>
+43
View File
@@ -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>
+17
View File
@@ -0,0 +1,17 @@
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
0.000000000000000000000000000000000000000000000000001
-0.000000000000000000000000000000000000000000000000001
1e2147483648
1e4294967296
1e9223372036854775808
1e18446744073709551616
1e-2147483649
1e-4294967296
1e-9223372036854775809
1e-18446744073709551616
self::-name
+46
View File
@@ -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'
+26
View File
@@ -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
+63
View File
@@ -0,0 +1,63 @@
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
12345678901234567890
-12345678901234567890
+43
View File
@@ -0,0 +1,43 @@
true()
false()
number("1.5")
number('abc')
-number('abc')
number('-')
floor(0.1)
floor(-0.1)
floor(-0)
floor(0)
floor(5.2)
floor(-5.2)
floor(100000000000000000000)
floor(-100000000000000000000)
floor(0 div 0)
floor(1 div 0)
floor(-1 div 0)
ceiling(0.1)
ceiling(-0.1)
ceiling(-0)
ceiling(0)
ceiling(5.2)
ceiling(-5.2)
ceiling(100000000000000000000)
ceiling(-100000000000000000000)
ceiling(0 div 0)
ceiling(1 div 0)
ceiling(-1 div 0)
round(0.1)
round(5.2)
round(5.5)
round(5.6)
round(-0.1)
round(-5.2)
round(-5.5)
round(-5.6)
round(0.5)
round(-0.5)
round(100000000000000000000)
round(-100000000000000000000)
round(0 div 0)
round(1 div 0)
round(-1 div 0)
+50
View File
@@ -0,0 +1,50 @@
string(5)
string(0.5)
string(-0.5)
string(true())
string(false())
string(12345678901234567890)
string(-12345678901234567890)
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)
substring("12345",-0.7,4)
substring("12345",-5000000000,5000000004)
substring-after("12345678","345")
substring-after("12345678","999")
substring-before("12345678","345")
substring-before("12345678","999")
string-length("")
string-length("titi")
normalize-space(" abc def ")
normalize-space(" abc def")
normalize-space("abc def ")
normalize-space(" abcdef ")
normalize-space(" abcdef")
normalize-space("abcdef ")
+17
View File
@@ -0,0 +1,17 @@
/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]
//p[0 div 0]
//p[100000000000000000000]
//p[-100000000000000000000]
//chapter[true()][position() mod 2 = 1][true()][2]
//chapter[true()][2][true()]
//node()[false()]
(//node())[false()]
+8
View File
@@ -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::*
+3
View File
@@ -0,0 +1,3 @@
//*[@id="root"]
//*[@id="chapter2"]
//*[@id="chapter5"]
+5
View File
@@ -0,0 +1,5 @@
//*[lang('en')]
//*[lang('en-us')]
//*[lang('en-gb')]
//*[lang('fr')]
//*[lang('')]
+7
View File
@@ -0,0 +1,7 @@
s
s|p1/s
s|/root/p1/s
/root/p1/s|s
//s
//s|p1
p1|//s
+5
View File
@@ -0,0 +1,5 @@
/.
//.
/root//.
//.//./././/.
/root//././/bar//.
+5
View File
@@ -0,0 +1,5 @@
/doc/elem/namespace::node()/..
/doc/elem/namespace::*/self::node()[true()]
//*[namespace::ns1]
/doc/elem/namespace::ns2/following::*
/doc/elem/namespace::ns2/preceding::*
+10
View File
@@ -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()]
+16
View File
@@ -0,0 +1,16 @@
/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
/child::EXAMPLE/attribute::prop2/preceding::text()
+1
View File
@@ -0,0 +1 @@
//p[.='abc']
+1
View File
@@ -0,0 +1 @@
/文書
+1
View File
@@ -0,0 +1 @@
//ITEM[1]
+5
View File
@@ -0,0 +1,5 @@
id('chapter1')
id('chapter3')
id('chapter1')/p
id('chapter1')//p
id('chapter1')/p[1]
+8
View File
@@ -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)
+6
View File
@@ -0,0 +1,6 @@
xpath1(//chapitre[2])
xpath1(//chapter[2])
xpath1(//chapitre[2])xpath1(//chapter[2])
xpath1(id("chapter1"))
xpath1(//*[@id="chapter1"])
xpath1(id("chapter1"))xpath1(//*[@id="chapter1"])
+1
View File
@@ -0,0 +1 @@
xmlns(b=abc://d/e:f) xpath1(/b:rootB)
+1
View File
@@ -0,0 +1 @@
xpath1(id('chapter1')/p)
+4
View File
@@ -0,0 +1,4 @@
/1/2/3
element(/1/2/3)
chapter1/3
element(chapter1/3)
+1
View File
@@ -0,0 +1 @@
xpath1(non-existing-fn())
+3
View File
@@ -0,0 +1,3 @@
xpath1(id("chapter1"))
xpath1(//*[@id="chapter1"])
xpath1(id("chapter1"))xpath1(//*[@id="chapter1"])