[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,10 @@
<sch:schema xmlns:sch="http://purl.oclc.org/dsdl/schematron">
<sch:pattern id="">
<sch:rule context="boo0">
<sch:report test="not(0)">
<sch:name path="&#9;e|namespace::*|e"/>
</sch:report>
<sch:report test="0"></sch:report>
</sch:rule>
</sch:pattern>
</sch:schema>
@@ -0,0 +1,6 @@
<librar0>
<boo0 t="">
<author></author>
</boo0>
<ins></ins>
</librar0>
@@ -0,0 +1,9 @@
<sch:schema xmlns:sch="http://purl.oclc.org/dsdl/schematron">
<sch:pattern id="">
<sch:rule context="boo0">
<sch:report test="not(0)">
<sch:name path="/"/>
</sch:report>
</sch:rule>
</sch:pattern>
</sch:schema>
@@ -0,0 +1,3 @@
<librar0>
<boo0/>
</librar0>
+23
View File
@@ -0,0 +1,23 @@
<schema xmlns="http://www.ascc.net/xml/schematron" >
<pattern name="Print both cases">
<rule context="AAA">
<assert test="BBB">BBB element is missing.</assert>
<report test="BBB">BBB element is present.</report>
<assert test="@name">AAA misses attribute name.</assert>
<report test="@name">AAA contains attribute name.</report>
</rule>
</pattern>
<pattern name="Print positive result only">
<rule context="AAA">
<report test="BBB">BBB element is present.</report>
<report test="@name">AAA contains attribute name.</report>
</rule>
</pattern>
<pattern name="Print negative result only">
<rule context="AAA">
<assert test="BBB">BBB element is missing.</assert>
<assert test="@name">AAA misses attribute name.</assert>
</rule>
</pattern>
</schema>
+15
View File
@@ -0,0 +1,15 @@
<schema xmlns="http://www.ascc.net/xml/schematron" >
<pattern name="Open model">
<rule context="AAA">
<assert test="BBB"> BBB element is not present</assert>
<assert test="CCC"> CCC element is not present</assert>
</rule>
</pattern>
<pattern name="Closed model">
<rule context="AAA">
<assert test="BBB"> BBB element is not present</assert>
<assert test="CCC"> CCC element is not present</assert>
<assert test="count(BBB|CCC) = count (*)">There is an extra element</assert>
</rule>
</pattern>
</schema>
+3
View File
@@ -0,0 +1,3 @@
<AAA>
<BBB/>
</AAA>
+4
View File
@@ -0,0 +1,4 @@
<AAA>
<BBB/>
<DDD/>
</AAA>
+8
View File
@@ -0,0 +1,8 @@
<schema xmlns="http://www.ascc.net/xml/schematron" >
<pattern name="Attributes present">
<rule context="BBB">
<assert test="not(@aaa) or (@aaa and @bbb)">The element must not have an isolated aaa attribute</assert>
<assert test="not(@bbb) or (@aaa and @bbb)">The element must not have an isolated bbb attribute</assert>
</rule>
</pattern>
</schema>
+3
View File
@@ -0,0 +1,3 @@
<AAA>
<BBB aaa="A" bbb="B"/>
</AAA>
+3
View File
@@ -0,0 +1,3 @@
<AAA>
<BBB bbb="B"/>
</AAA>
+3
View File
@@ -0,0 +1,3 @@
<AAA>
<BBB aaa="A"/>
</AAA>
+3
View File
@@ -0,0 +1,3 @@
<AAA>
<BBB/>
</AAA>
+8
View File
@@ -0,0 +1,8 @@
<schema xmlns="http://www.ascc.net/xml/schematron" >
<pattern name="Number of characters in an abbreviation">
<rule context="BBB">
<report test="string-length(@bbb) &lt; 2">There is not enough letters in the abbreviation</report>
<report test="string-length(@bbb) > 3">There is too much letters in the abbreviation</report>
</rule>
</pattern>
</schema>
+3
View File
@@ -0,0 +1,3 @@
<AAA>
<BBB bbb="C"/>
</AAA>
+3
View File
@@ -0,0 +1,3 @@
<AAA>
<BBB bbb="CZ"/>
</AAA>
+3
View File
@@ -0,0 +1,3 @@
<AAA>
<BBB bbb="CZCZ"/>
</AAA>
+7
View File
@@ -0,0 +1,7 @@
<schema xmlns="http://www.ascc.net/xml/schematron" >
<pattern name="Sum equals 100%.">
<rule context="Total">
<assert test="sum(//Percent) = 100">The values do not sum to 100%. </assert>
</rule>
</pattern>
</schema>
+6
View File
@@ -0,0 +1,6 @@
<Total>
<Percent>20</Percent>
<Percent>30</Percent>
<Percent>10</Percent>
<Percent>50</Percent>
</Total>
+5
View File
@@ -0,0 +1,5 @@
<Total>
<Percent>20</Percent>
<Percent>10</Percent>
<Percent>50</Percent>
</Total>
+5
View File
@@ -0,0 +1,5 @@
<Total>
<Percent>20</Percent>
<Percent>30</Percent>
<Percent>50</Percent>
</Total>
+10
View File
@@ -0,0 +1,10 @@
<schema xmlns="http://www.ascc.net/xml/schematron" >
<pattern name="a child of selected elements">
<rule context="CCC">
<assert test="parent::*[name()='BBB' or name()='DDD']">Element CCC must not be a child of element
<name path="parent::*"/>
</assert>
</rule>
</pattern>
</schema>
+12
View File
@@ -0,0 +1,12 @@
<AAA>
<BBB>
<CCC/>
</BBB>
<CCC/>
<DDD>
<CCC/>
<EEE>
<CCC/>
</EEE>
</DDD>
</AAA>
+11
View File
@@ -0,0 +1,11 @@
<schema xmlns="http://www.ascc.net/xml/schematron" >
<pattern name="id is the only permited attribute name">
<rule context="*">
<report test="@*[not(name()='id')]">Attribute
<name path="@*[not(name()='id')]"/> is forbidden in element
<name/>
</report>
</rule>
</pattern>
</schema>
+4
View File
@@ -0,0 +1,4 @@
<AAA name="aaa">
<BBB id="bbb"/>
<CCC color="ccc"/>
</AAA>
+7
View File
@@ -0,0 +1,7 @@
<sch:schema xmlns:sch="http://purl.oclc.org/dsdl/schematron">
<sch:pattern id="TestPattern">
<sch:rule context="book">
<sch:report test="not(@available)">Book <sch:value-of select="falae()"/> test</sch:report>
</sch:rule>
</sch:pattern>
</sch:schema>
+5
View File
@@ -0,0 +1,5 @@
<library>
<book title="Test Book" id="bk101">
<author>Test Author</author>
</book>
</library>
+3
View File
@@ -0,0 +1,3 @@
<AAA>
<BBB/>
</AAA>
+3
View File
@@ -0,0 +1,3 @@
<AAA>
<CCC/>
</AAA>
+9
View File
@@ -0,0 +1,9 @@
<schema xmlns="http://www.ascc.net/xml/schematron" >
<pattern name="Character @ forbidden">
<rule context="*">
<report test="contains(.,'@')">Text in element
<name/> must not contain character @
</report>
</rule>
</pattern>
</schema>
+4
View File
@@ -0,0 +1,4 @@
<AAA>
<BBB>bbbb</BBB>
<CCC>cccc</CCC>
</AAA>
+4
View File
@@ -0,0 +1,4 @@
<AAA>
<BBB>bbbb@bbb.com</BBB>
<CCC>ccc@ccc.com</CCC>
</AAA>
+5
View File
@@ -0,0 +1,5 @@
<AAA>
<BBB>bbbb</BBB>
<CCC>cccc</CCC>
aaa@aaa.net
</AAA>
+8
View File
@@ -0,0 +1,8 @@
<schema xmlns="http://www.ascc.net/xml/schematron" >
<pattern name="Attribute test">
<rule context="CCC">
<assert test="@name">attribute name is not present</assert>
<report test="@name">attribute name is present</report>
</rule>
</pattern>
</schema>
+8
View File
@@ -0,0 +1,8 @@
<AAA>
<BBB>
<CCC/>
<CCC/>
</BBB>
<CCC name="c1"/>
<CCC name="c2"/>
</AAA>
+10
View File
@@ -0,0 +1,10 @@
<schema xmlns="http://www.ascc.net/xml/schematron" >
<pattern name="Root test">
<rule context="/*">
<assert test="name()='AAA'">Root element is
<name/>, not AAA
</assert>
<report test="name()='AAA'">Root element is AAA</report>
</rule>
</pattern>
</schema>
+6
View File
@@ -0,0 +1,6 @@
<AAA>
<BBB>
<CCC/>
<CCC/>
</BBB>
</AAA>
+6
View File
@@ -0,0 +1,6 @@
<XXX>
<BBB>
<CCC/>
<CCC/>
</BBB>
</XXX>
+12
View File
@@ -0,0 +1,12 @@
<schema xmlns="http://www.ascc.net/xml/schematron" >
<pattern name="Select empty elements CCC">
<rule context="CCC">
<assert test="normalize-space(.) and *">Source contains an empty element CCC </assert>
<report test="normalize-space(.) = ''">[1]An element CCC does not contain any text</report>
<assert test="normalize-space(.)">[2]An element CCC does not contain any text</assert>
<report test="not(*)">[1]An element CCC does not contain any child element</report>
<assert test="*">[2]An element CCC does not contain any child element</assert>
</rule>
</pattern>
</schema>
+5
View File
@@ -0,0 +1,5 @@
<AAA>
<BBB>
<CCC/>
</BBB>
</AAA>
+5
View File
@@ -0,0 +1,5 @@
<AAA>
<BBB>
<CCC>I am CCC element</CCC>
</BBB>
</AAA>
+7
View File
@@ -0,0 +1,7 @@
<AAA>
<BBB>
<CCC>
<DDD/>
</CCC>
</BBB>
</AAA>
+8
View File
@@ -0,0 +1,8 @@
<schema xmlns="http://www.ascc.net/xml/schematron" >
<pattern name="Predefined values">
<rule context="AAA">
<report test="normalize-space(.) = 'aaa' or normalize-space(.) = 'bbb'">O.K.</report>
<assert test="normalize-space(.) = 'aaa' or normalize-space(.) = 'bbb'">The AAA value is not permitted.</assert>
</rule>
</pattern>
</schema>
+3
View File
@@ -0,0 +1,3 @@
<AAA>
aaa
</AAA>
+3
View File
@@ -0,0 +1,3 @@
<AAA>
bbb
</AAA>
+3
View File
@@ -0,0 +1,3 @@
<AAA>
ccc
</AAA>
+9
View File
@@ -0,0 +1,9 @@
<schema xmlns="http://www.ascc.net/xml/schematron" >
<pattern name="Test integer">
<rule context="AAA">
<report test="floor(.) = number(.)">O.K.</report>
<assert test="floor(.) = number(.)">The AAA value is not an integer.</assert>
</rule>
</pattern>
</schema>
+3
View File
@@ -0,0 +1,3 @@
<AAA>
aaa
</AAA>
+3
View File
@@ -0,0 +1,3 @@
<AAA>
12.234
</AAA>
+3
View File
@@ -0,0 +1,3 @@
<AAA>
45
</AAA>
+3
View File
@@ -0,0 +1,3 @@
<AAA>
0
</AAA>
+3
View File
@@ -0,0 +1,3 @@
<AAA>
-45
</AAA>
+10
View File
@@ -0,0 +1,10 @@
<schema xmlns="http://www.ascc.net/xml/schematron" >
<pattern name="Test count">
<rule context="/*">
<report test="count(//BBB) = count(//AAA)">O.K.</report>
<assert test="count(//BBB) &lt;= count(//AAA)">Some AAA are missing</assert>
<report test="count(//BBB) &lt; count(//AAA)">Some BBB are missing</report>
</rule>
</pattern>
</schema>
+8
View File
@@ -0,0 +1,8 @@
<XXX>
<BBB/>
<BBB/>
<AAA/>
<BBB/>
<AAA/>
<AAA/>
</XXX>
+7
View File
@@ -0,0 +1,7 @@
<XXX>
<BBB/>
<AAA/>
<BBB/>
<AAA/>
<AAA/>
</XXX>
+7
View File
@@ -0,0 +1,7 @@
<XXX>
<BBB/>
<BBB/>
<AAA/>
<BBB/>
<AAA/>
</XXX>
+9
View File
@@ -0,0 +1,9 @@
<schema xmlns="http://www.ascc.net/xml/schematron" >
<pattern name="Test attribute">
<rule context="CCC">
<report test="parent::BBB and not(@id)">Attribute id is missing</report>
<report test="not(parent::BBB) and @id">Attribute id is used in wrong context</report>
</rule>
</pattern>
</schema>
+7
View File
@@ -0,0 +1,7 @@
<AAA>
<CCC/>
<CCC/>
<BBB>
<CCC id="Q1"/>
</BBB>
</AAA>
+7
View File
@@ -0,0 +1,7 @@
<AAA>
<CCC id="Q2"/>
<CCC/>
<BBB>
<CCC id="Q1"/>
</BBB>
</AAA>
+7
View File
@@ -0,0 +1,7 @@
<AAA>
<CCC/>
<CCC/>
<BBB>
<CCC/>
</BBB>
</AAA>