xml-twig 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +674 -0
- package/README.md +378 -0
- package/demo/demo.js +18 -0
- package/demo/memory-test.js +71 -0
- package/demo/speed-test.js +66 -0
- package/doc/build.sh +6 -0
- package/doc/twig.md +1449 -9
- package/package.json +37 -0
- package/samples/bookstore.xml +48 -0
- package/samples/breakfast-menu.xml +43 -0
- package/samples/processingInstruction.xml +29 -0
- package/samples/xmlns.xml +19 -0
- package/twig.js +1139 -0
package/package.json
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
{
|
|
2
|
+
"dependencies": {
|
|
3
|
+
"node-expat": "^2.4.0",
|
|
4
|
+
"sax": "^1.3.0",
|
|
5
|
+
"xml-writer": "^1.7.0"
|
|
6
|
+
},
|
|
7
|
+
"name": "xml-twig",
|
|
8
|
+
"description": "Node module for processing huge XML documents in tree mode",
|
|
9
|
+
"version": "1.0.0",
|
|
10
|
+
"main": "twig.js",
|
|
11
|
+
"directories": {
|
|
12
|
+
"doc": "doc"
|
|
13
|
+
},
|
|
14
|
+
"devDependencies": {
|
|
15
|
+
"luxon": "^2.1.1"
|
|
16
|
+
},
|
|
17
|
+
"scripts": {
|
|
18
|
+
"test": "node demo.js"
|
|
19
|
+
},
|
|
20
|
+
"repository": {
|
|
21
|
+
"type": "git",
|
|
22
|
+
"url": "git+https://github.com/Wernfried/xml-twig.git"
|
|
23
|
+
},
|
|
24
|
+
"keywords": [
|
|
25
|
+
"xml",
|
|
26
|
+
"sax",
|
|
27
|
+
"expat",
|
|
28
|
+
"parser",
|
|
29
|
+
"xml-reader"
|
|
30
|
+
],
|
|
31
|
+
"author": "Wernfried Domscheit",
|
|
32
|
+
"license": "ISC",
|
|
33
|
+
"bugs": {
|
|
34
|
+
"url": "https://github.com/Wernfried/xml-twig/issues"
|
|
35
|
+
},
|
|
36
|
+
"homepage": "https://github.com/Wernfried/xml-twig#readme"
|
|
37
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<bookstore>
|
|
3
|
+
<book category="cooking">
|
|
4
|
+
<title lang="en">Everyday Italian</title>
|
|
5
|
+
<author>Giada De Laurentiis</author>
|
|
6
|
+
<year>2005</year>
|
|
7
|
+
<price>30.00</price>
|
|
8
|
+
</book>
|
|
9
|
+
<!-- A comment -->
|
|
10
|
+
<book category="children">
|
|
11
|
+
<title lang="en">Harry Potter</title>
|
|
12
|
+
<author>J K. Rowling</author>
|
|
13
|
+
<year>2005</year>
|
|
14
|
+
<price>29.99</price>
|
|
15
|
+
</book>
|
|
16
|
+
<ebook category="fantasy">
|
|
17
|
+
<title lang="en">Harry Potter</title>
|
|
18
|
+
<author>Joanne Kathleen Rowling</author>
|
|
19
|
+
<year>2001 </year>
|
|
20
|
+
<price>12.99</price>
|
|
21
|
+
<format>Kindle</format>
|
|
22
|
+
<device>ePub</device>
|
|
23
|
+
</ebook>
|
|
24
|
+
<book category="web">
|
|
25
|
+
<title lang="en">XQuery Kick Start</title>
|
|
26
|
+
<author>James McGovern</author>
|
|
27
|
+
<author>Per Bothner</author>
|
|
28
|
+
<author>Kurt Cagle</author>
|
|
29
|
+
<author>James Linn</author>
|
|
30
|
+
<author>Vaidyanathan Nagarajan</author>
|
|
31
|
+
<year>2003</year>
|
|
32
|
+
<price>29.99</price>
|
|
33
|
+
</book>
|
|
34
|
+
<ebook category="biography">
|
|
35
|
+
<title lang="en">The Autobiography of Benjamin Franklin</title>
|
|
36
|
+
<author>Benjamin Franklin</author>
|
|
37
|
+
<year>1996</year>
|
|
38
|
+
<price>39.99</price>
|
|
39
|
+
<format>Kindle</format>
|
|
40
|
+
<device>ePub</device>
|
|
41
|
+
</ebook>
|
|
42
|
+
<book category="web">
|
|
43
|
+
<title lang="en">Learning XML</title>
|
|
44
|
+
<author>Erik T. Ray</author>
|
|
45
|
+
<year>2003</year>
|
|
46
|
+
<price>39.95</price>
|
|
47
|
+
</book>
|
|
48
|
+
</bookstore>
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<breakfast_menu>
|
|
3
|
+
<food>
|
|
4
|
+
<name>Belgian Waffles</name>
|
|
5
|
+
<price>$5.95</price>
|
|
6
|
+
<description>
|
|
7
|
+
Two of our famous Belgian Waffles with plenty of real maple syrup
|
|
8
|
+
</description>
|
|
9
|
+
<calories>650</calories>
|
|
10
|
+
</food>
|
|
11
|
+
<food>
|
|
12
|
+
<name>Strawberry Belgian Waffles</name>
|
|
13
|
+
<price>$7.95</price>
|
|
14
|
+
<description>
|
|
15
|
+
Light Belgian waffles covered with strawberries and whipped cream
|
|
16
|
+
</description>
|
|
17
|
+
<calories>900</calories>
|
|
18
|
+
</food>
|
|
19
|
+
<food>
|
|
20
|
+
<name>Berry-Berry Belgian Waffles</name>
|
|
21
|
+
<price>$8.95</price>
|
|
22
|
+
<description>
|
|
23
|
+
Belgian waffles covered with assorted fresh berries and whipped cream
|
|
24
|
+
</description>
|
|
25
|
+
<calories>900</calories>
|
|
26
|
+
</food>
|
|
27
|
+
<food>
|
|
28
|
+
<name>French Toast</name>
|
|
29
|
+
<price>$4.50</price>
|
|
30
|
+
<description>
|
|
31
|
+
Thick slices made from our homemade sourdough bread
|
|
32
|
+
</description>
|
|
33
|
+
<calories>600</calories>
|
|
34
|
+
</food>
|
|
35
|
+
<food>
|
|
36
|
+
<name>Homestyle Breakfast</name>
|
|
37
|
+
<price>$6.95</price>
|
|
38
|
+
<description>
|
|
39
|
+
Two eggs, bacon or sausage, toast, and our ever-popular hash browns
|
|
40
|
+
</description>
|
|
41
|
+
<calories>950</calories>
|
|
42
|
+
</food>
|
|
43
|
+
</breakfast_menu>
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<?xml-stylesheet type="text/xsl" href="style.xsl"?>
|
|
3
|
+
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
|
|
4
|
+
<xsl:template match="/">
|
|
5
|
+
<emptyElement/>
|
|
6
|
+
<html>
|
|
7
|
+
<body>xx<!--Your comment-->xx
|
|
8
|
+
<h2>My CD Collection</h2>
|
|
9
|
+
<table border="1">
|
|
10
|
+
<tr>
|
|
11
|
+
<th style="text-align:left">Title</th>
|
|
12
|
+
<th style="text-align:left">Artist</th>
|
|
13
|
+
</tr>
|
|
14
|
+
<xsl:for-each select="catalog/cd">
|
|
15
|
+
<tr>
|
|
16
|
+
<td>
|
|
17
|
+
<xsl:value-of select="title"/>
|
|
18
|
+
</td>
|
|
19
|
+
<td>
|
|
20
|
+
<xsl:value-of select="artist"/>
|
|
21
|
+
</td>
|
|
22
|
+
</tr>
|
|
23
|
+
</xsl:for-each>
|
|
24
|
+
</table>
|
|
25
|
+
</body>
|
|
26
|
+
</html>
|
|
27
|
+
</xsl:template>
|
|
28
|
+
</xsl:stylesheet>
|
|
29
|
+
<?xml-stylesheet type="text/xsl" href="style.xsl"?>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
<root>
|
|
2
|
+
<h:table xmlns:h="http://www.w3.org/TR/html4/" id="1">
|
|
3
|
+
<h:tr>
|
|
4
|
+
<h:td>Apples</h:td>
|
|
5
|
+
<h:td>Bananas</h:td>
|
|
6
|
+
</h:tr>
|
|
7
|
+
</h:table>
|
|
8
|
+
<f:table xmlns:f="https://www.w3schools.com/furniture">
|
|
9
|
+
<f:name>African Coffee Table</f:name>
|
|
10
|
+
<f:width>80</f:width>
|
|
11
|
+
<f:length>120</f:length>
|
|
12
|
+
</f:table>
|
|
13
|
+
<book category="web">
|
|
14
|
+
<title lang="en">Learning XML</title>
|
|
15
|
+
<author>Erik T. Ray</author>
|
|
16
|
+
<year>2003</year>
|
|
17
|
+
<price>39.95</price>
|
|
18
|
+
</book>
|
|
19
|
+
</root>
|