[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
@@ -0,0 +1 @@
<!-- Empty DTD -->
@@ -0,0 +1,14 @@
<?xml version="1.0"?>
<?xml-stylesheet href="doc.xsl"
type="text/xsl" ?>
<!DOCTYPE doc SYSTEM "doc.dtd">
<doc>Hello, world!<!-- Comment 1 --></doc>
<?pi-without-data ?>
<!-- Comment 2 -->
<!-- Comment 3 -->
@@ -0,0 +1,11 @@
<doc>
<clean> </clean>
<dirty> A B </dirty>
<mixed>
A
<clean> </clean>
B
<dirty> A B </dirty>
C
</mixed>
</doc>
@@ -0,0 +1,18 @@
<!DOCTYPE doc [<!ATTLIST e9 attr CDATA "default">]>
<doc>
<e1 />
<e2 ></e2>
<e3 name = "elem3" id="elem3" />
<e4 name="elem4" id="elem4" ></e4>
<e5 a:attr="out" b:attr="sorted" attr2="all" attr="I'm"
xmlns:b="http://www.ietf.org"
xmlns:a="http://www.w3.org"
xmlns="http://www.uvic.ca"/>
<e6 xmlns="" xmlns:a="http://www.w3.org">
<e7 xmlns="http://www.ietf.org">
<e8 xmlns="" xmlns:a="http://www.w3.org">
<e9 xmlns="" xmlns:a="http://www.ietf.org"/>
</e8>
</e7>
</e6>
</doc>
@@ -0,0 +1,9 @@
<!DOCTYPE doc [<!ATTLIST normId id ID #IMPLIED>]>
<doc>
<text>First line&#x0d;&#10;Second line</text>
<value>&#x32;</value>
<compute><![CDATA[value>"0" && value<"10" ?"valid":"error"]]></compute>
<compute expr='value>"0" &amp;&amp; value&lt;"10" ?"valid":"error"'>valid</compute>
<norm attr=' &apos; &#x20;&#13;&#xa;&#9; &apos; '/>
<normId id=' &apos; &#x20;&#13;&#xa;&#9; &apos; '/>
</doc>
@@ -0,0 +1,12 @@
<!DOCTYPE doc [
<!ATTLIST doc attrExtEnt ENTITY #IMPLIED>
<!ENTITY ent1 "Hello">
<!ENTITY ent2 SYSTEM "world.txt">
<!ENTITY entExt SYSTEM "earth.gif" NDATA gif>
<!NOTATION gif SYSTEM "viewgif.exe">
]>
<doc attrExtEnt="entExt">
&ent1;, &ent2;!
</doc>
<!-- Let world.txt contain "world" (excluding the quotes) -->
@@ -0,0 +1,2 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<doc>&#169;</doc>
@@ -0,0 +1,11 @@
<!DOCTYPE doc [
<!ATTLIST e2 xml:space (default|preserve) 'preserve'>
<!ATTLIST e3 id ID #IMPLIED>
]>
<doc xmlns="http://www.ietf.org" xmlns:w3c="http://www.w3.org">
<e1>
<e2 xmlns="">
<e3 id="E3"/>
</e2>
</e1>
</doc>
@@ -0,0 +1,10 @@
<XPath xmlns:ietf="http://www.ietf.org" >
(//.|//@*|//namespace::*)
[
self::ietf:e1
or
(parent::ietf:e1 and not(self::text() or self::e2))
or
count(id("E3")|ancestor-or-self::node()) = count(ancestor-or-self::node())
]
</XPath>
@@ -0,0 +1,12 @@
<?xml version="1.0"?>
<foo:Root xmlns:bar="http://example.org/bar" xmlns:baz="http://example.org/baz" xmlns:foo="http://example.org/foo" xmlns="http://example.org/" xml:lang="en-ie">
<bar:Something>
<foo:Something>
<bar:Something>
<foo:Something>
<baz:Something />
</foo:Something>
</bar:Something>
</foo:Something>
</bar:Something>
</foo:Root>
@@ -0,0 +1,8 @@
<?xml version="1.0"?>
<XPath xmlns:bar="http://example.org/bar" xmlns:baz="http://example.org/baz" xmlns:foo="http://example.org/foo" xml:lang="en-ie">
(//. | //@* | //namespace::*)
[
<!-- everything -->
ancestor-or-self::bar:Something
]
</XPath>
@@ -0,0 +1,12 @@
<?xml version="1.0"?>
<foo:Root xmlns:bar="http://example.org/bar" xmlns:baz="http://example.org/baz" xmlns:foo="http://example.org/foo" xmlns="http://example.org/" xml:lang="en-ie">
<bar:Something>
<foo:Something>
<bar:Something>
<foo:Something>
<baz:Something />
</foo:Something>
</bar:Something>
</foo:Something>
</bar:Something>
</foo:Root>
@@ -0,0 +1,12 @@
<?xml version="1.0"?>
<XPath xmlns:bar="http://example.org/bar" xmlns:baz="http://example.org/baz" xmlns:foo="http://example.org/foo" xml:lang="en-ie">
(//. | //@* | //namespace::*)
[
<!-- only text, elements or directly-used namespace nodes -->
ancestor-or-self::bar:Something and
((name() != "bar") or parent::bar:Something) and
((name() != "foo") or parent::foo:Something) and
((name() != "baz") or parent::baz:Something) and
((name() != "") or self::text())
]
</XPath>
@@ -0,0 +1,12 @@
<?xml version="1.0"?>
<foo:Root xmlns:bar="http://example.org/bar" xmlns:baz="http://example.org/baz" xmlns:foo="http://example.org/foo" xmlns="http://example.org/" xml:lang="en-ie">
<bar:Something>
<foo:Something>
<bar:Something>
<foo:Something>
<baz:Something />
</foo:Something>
</bar:Something>
</foo:Something>
</bar:Something>
</foo:Root>
@@ -0,0 +1,11 @@
<?xml version="1.0"?>
<XPath xmlns:bar="http://example.org/bar" xmlns:baz="http://example.org/baz" xmlns:foo="http://example.org/foo" xml:lang="en-ie">
(//. | //@* | //namespace::*)
[
<!-- only text, elements or directly-used namespace nodes -->
ancestor-or-self::bar:Something and
(self::text() or
(namespace-uri() != "") or
(string(self::node()) = namespace-uri(parent::node())))
]
</XPath>
@@ -0,0 +1,12 @@
<?xml version="1.0"?>
<foo:Root xmlns:bar="http://example.org/bar" xmlns:baz="http://example.org/baz" xmlns:foo="http://example.org/foo" xmlns="http://example.org/" xml:lang="en-ie">
<bar:Something>
<foo:Something>
<bar:Something>
<foo:Something>
<baz:Something />
</foo:Something>
</bar:Something>
</foo:Something>
</bar:Something>
</foo:Root>
@@ -0,0 +1,12 @@
<?xml version="1.0"?>
<XPath xmlns:bar="http://example.org/bar" xmlns:baz="http://example.org/baz" xmlns:foo="http://example.org/foo" xml:lang="en-ie">
(//. | //@* | //namespace::*)
[
<!-- only text, elements, or directly-used namespace nodes but not foo:Something -->
ancestor-or-self::bar:Something and
not (self::foo:Something) and
(self::text() or
(namespace-uri() != "") or
(string(self::node()) = namespace-uri(parent::node())))
]
</XPath>
@@ -0,0 +1,12 @@
<?xml version="1.0"?>
<foo:Root xmlns:bar="http://example.org/bar" xmlns:baz="http://example.org/baz" xmlns:foo="http://example.org/foo" xmlns="http://example.org/" xml:lang="en-ie">
<bar:Something>
<foo:Something>
<bar:Something>
<foo:Something>
<baz:Something />
</foo:Something>
</bar:Something>
</foo:Something>
</bar:Something>
</foo:Root>
@@ -0,0 +1,10 @@
<?xml version="1.0"?>
<XPath xmlns:bar="http://example.org/bar" xmlns:baz="http://example.org/baz" xmlns:foo="http://example.org/foo" xml:lang="en-ie">
(//. | //@* | //namespace::*)
[
<!-- no namespace nodes; I am not in my parent's namespace axis -->
ancestor-or-self::bar:Something and
(count(parent::node()/namespace::*) !=
count(parent::node()/namespace::* | self::node()))
]
</XPath>
@@ -0,0 +1,12 @@
<?xml version="1.0"?>
<foo:Root xmlns:bar="http://example.org/bar" xmlns:baz="http://example.org/baz" xmlns:foo="http://example.org/foo" xmlns="http://example.org/" xml:lang="en-ie">
<bar:Something>
<foo:Something>
<bar:Something>
<foo:Something>
<baz:Something />
</foo:Something>
</bar:Something>
</foo:Something>
</bar:Something>
</foo:Root>
@@ -0,0 +1,10 @@
<?xml version="1.0"?>
<XPath xmlns:bar="http://example.org/bar" xmlns:baz="http://example.org/baz" xmlns:foo="http://example.org/foo" xml:lang="en-ie">
(//. | //@* | //namespace::*)
[
<!-- no namespace nodes; I am text or have nonempty namespace URI -->
ancestor-or-self::bar:Something and
(self::text() or
(namespace-uri() != ""))
]
</XPath>
@@ -0,0 +1,12 @@
<?xml version="1.0"?>
<foo:Root xmlns:bar="http://example.org/bar" xmlns:baz="http://example.org/baz" xmlns:foo="http://example.org/foo" xmlns="http://example.org/" xml:lang="en-ie">
<bar:Something>
<foo:Something>
<bar:Something>
<foo:Something>
<baz:Something />
</foo:Something>
</bar:Something>
</foo:Something>
</bar:Something>
</foo:Root>
@@ -0,0 +1,10 @@
<?xml version="1.0"?>
<XPath xmlns:bar="http://example.org/bar" xmlns:baz="http://example.org/baz" xmlns:foo="http://example.org/foo" xml:lang="en-ie">
(//. | //@* | //namespace::*)
[
<!-- only namespace nodes -->
ancestor-or-self::bar:Something and
(count(parent::node()/namespace::*) =
count(parent::node()/namespace::* | self::node()))
]
</XPath>
@@ -0,0 +1,12 @@
<?xml version="1.0"?>
<foo:Root xmlns:bar="http://example.org/bar" xmlns:baz="http://example.org/baz" xmlns:foo="http://example.org/foo" xmlns="http://example.org/" xml:lang="en-ie">
<bar:Something>
<foo:Something>
<bar:Something>
<foo:Something>
<baz:Something />
</foo:Something>
</bar:Something>
</foo:Something>
</bar:Something>
</foo:Root>
@@ -0,0 +1,9 @@
<?xml version="1.0"?>
<XPath xmlns:bar="http://example.org/bar" xmlns:baz="http://example.org/baz" xmlns:foo="http://example.org/foo" xml:lang="en-ie">
(//. | //@* | //namespace::*)
[
<!-- only directly-used namespace nodes -->
ancestor-or-self::bar:Something and
(string(self::node()) = namespace-uri(parent::node()))
]
</XPath>
@@ -0,0 +1,12 @@
<?xml version="1.0"?>
<foo:Root xmlns:bar="http://example.org/bar" xmlns:baz="http://example.org/baz" xmlns:foo="http://example.org/foo" xmlns="http://example.org/" xml:lang="en-ie">
<bar:Something>
<foo:Something>
<bar:Something>
<foo:Something>
<baz:Something />
</foo:Something>
</bar:Something>
</foo:Something>
</bar:Something>
</foo:Root>
@@ -0,0 +1,12 @@
<?xml version="1.0"?>
<XPath xmlns:bar="http://example.org/bar" xmlns:baz="http://example.org/baz" xmlns:foo="http://example.org/foo" xml:lang="en-ie">
(//. | //@* | //namespace::*)
[
<!-- no namespace nodes but the default on alternate elements -->
ancestor-or-self::bar:Something and
(self::text() or
(namespace-uri() != "") or
((name() = "") and
((count(ancestor-or-self::node()) mod 2) = 1)))
]
</XPath>
@@ -0,0 +1,9 @@
<?xml version="1.0"?>
<!DOCTYPE envelope [
<!ENTITY dsig "http://www.w3.org/2000/09/xmldsig#">
<!ENTITY c14n "http://www.w3.org/TR/2001/REC-xml-c14n-20010315">
<!ENTITY xpath "http://www.w3.org/TR/1999/REC-xpath-19991116">
<!ENTITY xslt "http://www.w3.org/TR/1999/REC-xslt-19991116">
<!ATTLIST Notaries Id ID #IMPLIED>
]>
<Object Id="object-1" MimeType="text/plain">I am the text.</Object>
@@ -0,0 +1,14 @@
<?xml version="1.0"?>
<!DOCTYPE envelope [
<!ENTITY dsig "http://www.w3.org/2000/09/xmldsig#">
<!ENTITY c14n "http://www.w3.org/TR/2001/REC-xml-c14n-20010315">
<!ENTITY xpath "http://www.w3.org/TR/1999/REC-xpath-19991116">
<!ENTITY xslt "http://www.w3.org/TR/1999/REC-xslt-19991116">
<!ATTLIST Notaries Id ID #IMPLIED>
]>
<XPath>
(//.|//@*|//namespace::*)
[
self::text()
]
</XPath>
@@ -0,0 +1,43 @@
<?xml version="1.0"?>
<!DOCTYPE envelope [
<!ENTITY dsig "http://www.w3.org/2000/09/xmldsig#">
<!ENTITY c14n "http://www.w3.org/TR/2001/REC-xml-c14n-20010315">
<!ENTITY xpath "http://www.w3.org/TR/1999/REC-xpath-19991116">
<!ENTITY xslt "http://www.w3.org/TR/1999/REC-xslt-19991116">
<!ATTLIST Notaries Id ID #IMPLIED>
]>
<Signature xmlns="http://www.w3.org/2000/09/xmldsig#" Id="signature">
<Object Id="object-4">
<X509Data>
<X509SubjectName>
CN=Merlin Hughes,O=Baltimore Technologies\, Ltd.,ST=Dublin,C=IE
</X509SubjectName>
<X509IssuerSerial>
<X509IssuerName>
CN=Test DSA CA,O=Baltimore Technologies\, Ltd.,ST=Dublin,C=IE
</X509IssuerName>
<X509SerialNumber>970849936</X509SerialNumber>
</X509IssuerSerial>
<X509Certificate>
MIIDNzCCAvWgAwIBAgIEOd3+kDAJBgcqhkjOOAQDMFsxCzAJBgNVBAYTAklFMQ8w
DQYDVQQIEwZEdWJsaW4xJTAjBgNVBAoTHEJhbHRpbW9yZSBUZWNobm9sb2dpZXMs
IEx0ZC4xFDASBgNVBAMTC1Rlc3QgRFNBIENBMB4XDTAwMTAwNjE2MzIxNVoXDTAx
MTAwNjE2MzIxNFowXTELMAkGA1UEBhMCSUUxDzANBgNVBAgTBkR1YmxpbjElMCMG
A1UEChMcQmFsdGltb3JlIFRlY2hub2xvZ2llcywgTHRkLjEWMBQGA1UEAxMNTWVy
bGluIEh1Z2hlczCCAbYwggErBgcqhkjOOAQBMIIBHgKBgQDaJjfDTrawMHf8MiUt
Y54b37hSmYNnR3KpGT10uU1Dqppcju06uN0iGbqf947DjkBC25hKnqykK31xBw0E
CPbYq/KC98kghdf2xJCu6B8aqJ95K9jdVflJ3WP7PQxJn+fmM23zy6HYLXVICpfq
etdNj/VHCShZE3bdJiE6VobSFQIVAPQecqS2PaTDprcQnkwx4MHTRXhrAoGAMuGA
lqeB1ax+vyO2+Osubjhl7pHxLu47RIH+/M52DjESA9KMSrwzsYx8yNR2WooByrE0
t6fu0VncK7UK8olO4t7wpv2z4AFQPRVCKFwo0qgn5aKIkICGMlrRy81avb27wGcW
othx3iPPMtFXtoDqK0JItaI9R8zc1msFhM1GKMYDgYQAAoGActA8YGxrtngg/zKV
vqEOefnwmViFztcnPBYPlJsvh6yKI4iDm68fnp4Mi3RrJ6bZAygFrUIQLxLjV+OJ
tgJAEto0xAs+Mehuq1DkSFEpP3oDzCTOsrOiS1DwQe4oIb7zVk/9l7aPtJMHW0LV
lMdwZNFNNJoqMcT2ZfCPrfvYvQ2jRzBFMB4GA1UdEQQXMBWBE21lcmxpbkBiYWx0
aW1vcmUuaWUwDgYDVR0PAQH/BAQDAgeAMBMGA1UdIwQMMAqACEJZQG0KwRbPMAkG
ByqGSM44BAMDMQAwLgIVAK4skWEFYgrggaJA8vYAwSjg12+KAhUAwHTo7wd4tENw
9LAKPklQ/74fH18=
</X509Certificate>
</X509Data>
</Object>
</Signature>
@@ -0,0 +1,14 @@
<?xml version="1.0"?>
<!DOCTYPE envelope [
<!ENTITY dsig "http://www.w3.org/2000/09/xmldsig#">
<!ENTITY c14n "http://www.w3.org/TR/2001/REC-xml-c14n-20010315">
<!ENTITY xpath "http://www.w3.org/TR/1999/REC-xpath-19991116">
<!ENTITY xslt "http://www.w3.org/TR/1999/REC-xslt-19991116">
<!ATTLIST Notaries Id ID #IMPLIED>
]>
<XPath xmlns:dsig="&dsig;">
(//.|//@*|//namespace::*)
[
ancestor-or-self::dsig:X509Data
]
</XPath>
@@ -0,0 +1,8 @@
<?xml version="1.0"?>
<n0:local xmlns:n0="foo://bar" xmlns:n3="ftp://example.org">
<n1:elem2 xmlns:n1="http://example.net" xml:lang="en">
<n3:stuff xmlns:n3="ftp://example.org"/>
</n1:elem2>
</n0:local>
@@ -0,0 +1,8 @@
<XPath xmlns:n1="http://example.net" >
(//. | //@* | //namespace::*)
[
ancestor-or-self::n1:elem2
]
</XPath>
@@ -0,0 +1,18 @@
<!DOCTYPE doc [<!ATTLIST e9 attr CDATA "default">]>
<doc xmlns:foo="http://www.bar.org" xml:base="http://www.example.org/2002/">
<e1 />
<e2 ></e2>
<e3 name = "elem3" id="elem3" />
<e4 name="elem4" id="elem4" ></e4>
<e5 a:attr="out" b:attr="sorted" attr2="all" attr="I'm"
xmlns:b="http://www.ietf.org"
xmlns:a="http://www.w3.org"
xmlns="http://example.org"/>
<e6 xmlns="" test="../baz" xmlns:a="http://www.w3.org">
<e7 xmlns="http://www.ietf.org">
<e8 xmlns="" xmlns:a="http://www.w3.org" a:foo="bar">
<e9 xmlns="" xmlns:a="http://www.ietf.org"/>
</e8>
</e7>
</e6>
</doc>
@@ -0,0 +1,3 @@
<XPath>
(//. | //@* | //namespace::*)[ancestor-or-self::e6]
</XPath>
@@ -0,0 +1 @@
world