Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Autobuild

  • Loading branch information...
commit f1101a4cf556321ad26aa8f8c2c939586cb12481 1 parent d1c2ded
o3builder o3builder authored
53 example/example.js
... ... @@ -0,0 +1,53 @@
  1 +var fastxml = require("../lib/o3-fastxml"),
  2 + doc,
  3 + xmlData = "\
  4 +<?xml version=\"1.0\"?>\n\
  5 +<catalog>\n\
  6 + <book id=\"bk101\" available=\"true\">\n\
  7 + <author>Gambardella, Matthew</author>\n\
  8 + <title>XML Developer's Guide</title>\n\
  9 + <genre>Computer</genre>\n\
  10 + <price>44.95</price>\n\
  11 + <publish_date>2000-10-01</publish_date>\n\
  12 + <description>An in-depth look at creating applications \n\
  13 + with XML.</description>\n\
  14 + </book>\n\
  15 + <book id=\"bk102\" available=\"false\">\n\
  16 + <author>Ralls, Kim</author>\n\
  17 + <title>Midnight Rain</title>\n\
  18 + <genre>Fantasy</genre>\n\
  19 + <price>5.95</price>\n\
  20 + <publish_date>2000-12-16</publish_date>\n\
  21 + <description>A former architect battles corporate zombies, \n\
  22 + an evil sorceress, and her own childhood to become queen \n\
  23 + of the world.</description>\n\
  24 + </book>\n\
  25 +</catalog>";
  26 +
  27 +doc = fastxml.parseFromString(xmlData);
  28 +console.log("-parsed document:\n" + doc.xml);
  29 +console.log("\n-traversing document element:");
  30 +var elem = doc.documentElement,
  31 +childNodes = elem.childNodes;
  32 +for (var i=0; i<childNodes.length; i++) {
  33 + console.log("name of child " + i + ": "
  34 + + childNodes[i].nodeName);
  35 + console.log("type of child " + i + ": "
  36 + + childNodes[i].nodeName);
  37 +}
  38 +
  39 +console.log("\n-attributes on first child of the document element:");
  40 +var child = elem.firstChild.nextSibling,
  41 +attributes = child.attributes;
  42 +console.log(child.nodeName);
  43 +for (var i=0; i<attributes.length; i++) {
  44 + console.log("attribute " + i + ": "
  45 + + attributes[i].name + " = "
  46 + + attributes[i].value);
  47 +}
  48 +
  49 +console.log("\n-xpath query:");
  50 +var xpathNodeList = elem.selectNodes(
  51 + "descendant-or-self::node()[@available='true']");
  52 +console.log("first element of the xpath querry: "
  53 + + xpathNodeList[0].getAttribute("id"));
2  lib/o3-fastxml/index.js
... ... @@ -0,0 +1,2 @@
  1 +var o3 = require('./o3');
  2 +module.exports = o3.fastxml;
BIN  lib/o3-fastxml/o3-osx64.node
Binary file not shown
10 lib/o3-fastxml/o3.js
... ... @@ -0,0 +1,10 @@
  1 +try {
  2 + module.exports = require('./o3.node').root
  3 +} catch (ex) {
  4 + if (process.platform == "cygwin")
  5 + module.exports = require('./o3-win32.node').root;
  6 + else if (process.platform == "darwin")
  7 + module.exports = require('./o3-osx64.node').root;
  8 + else
  9 + module.exports = require('./o3-lin32.node').root;
  10 +}
526 test/test.js
... ... @@ -0,0 +1,526 @@
  1 +var fs = require('fs');
  2 +var sys = require('sys');
  3 +var fastxml = require("../lib/o3-fastxml");
  4 +
  5 +function diff(node, node1) {
  6 + if (node.nodeType != node1.nodeType)
  7 + return false;
  8 + if (node.nodeName != node1.nodeName)
  9 + return false;
  10 + if (node.nodeValue != node1.nodeValue)
  11 + return false;
  12 + switch (node.nodeType) {
  13 + case node.DOCUMENT:
  14 + return diff(node.documentElement, node1.documentElement);
  15 + case node.ELEMENT:
  16 + var childNodes;
  17 + var attributes;
  18 + var length;
  19 +
  20 + childNodes = node.childNodes;
  21 + length = childNodes.length;
  22 + if (length != node1.childNodes.length)
  23 + return false;
  24 + for (var i = 0; i < length; ++i) {
  25 + if (!diff(childNodes[i], node1.childNodes[i]))
  26 + return false;
  27 + }
  28 + attributes = node.attributes;
  29 + length = attributes.length;
  30 + if (length != node1.attributes.length)
  31 + return false;
  32 + for (var i = 0; i < length; ++i) {
  33 + if (!diff(attributes[i], node1.attributes[i]))
  34 + return false;
  35 + }
  36 + return true;
  37 + case node.ATTRIBUTE:
  38 + return true;
  39 + default:
  40 + return true;
  41 + };
  42 +}
  43 +
  44 +function check(expected,actual) {
  45 + var l = expected.length;
  46 + if (l != actual.length) {
  47 + console.log('expected: ' + expected.toString()
  48 + + '\n\nactual: ' + actual.toString());
  49 + return false;
  50 + }
  51 +
  52 + for (var i=0; i<l; i++) {
  53 + if (expected[i] != actual[i]) {
  54 + console.log('expected: ' + expected.length
  55 + + '\n\nactual: ' + actual.length);
  56 +
  57 + return false;
  58 + }
  59 + }
  60 +
  61 + return true;
  62 +}
  63 +
  64 +function readFile(file) {
  65 + file = __dirname + "/" + file;
  66 + var size = fs.statSync(file).size,
  67 + buf = new Buffer(size),
  68 + fd = fs.openSync(file, 'r');
  69 + if (!size)
  70 + return "";
  71 + fs.readSync(fd, buf, 0, size, 0);
  72 + fs.closeSync(fd);
  73 + return buf.toString();
  74 +}
  75 +
  76 +var test = {
  77 +test0 : function() {
  78 + var doc = fastxml.parseFromString(readFile("test.xml")),
  79 + elem = doc.documentElement,
  80 + ref_parent = elem.childNodes[3];
  81 +
  82 + ref_parent.insertBefore(elem.childNodes[1].childNodes[3],
  83 + ref_parent.childNodes[3]);
  84 + elem.normalize();
  85 + return diff(doc, fastxml.parseFromString(readFile("test0.xml")));
  86 +},
  87 +
  88 +test1 : function() {
  89 + var doc = fastxml.parseFromString(readFile("test.xml")),
  90 + elem = doc.documentElement,
  91 + ref_parent = elem.childNodes[1];
  92 +
  93 + ref_parent.insertBefore(elem.childNodes[1].childNodes[3],
  94 + ref_parent.childNodes[7]);
  95 + elem.normalize();
  96 + return diff(doc, fastxml.parseFromString(readFile("test1.xml")));
  97 +},
  98 +
  99 +test2 : function() {
  100 + var doc = fastxml.parseFromString(readFile("test.xml")),
  101 + elem = doc.documentElement,
  102 + ref_parent = elem.childNodes[1];
  103 +
  104 + ref_parent.insertBefore(elem.childNodes[1].childNodes[3], ref_parent.childNodes[4])
  105 + elem.normalize();
  106 + return diff(doc, fastxml.parseFromString(readFile("test2.xml")));
  107 +},
  108 +
  109 +test3 : function() {
  110 + var doc = fastxml.parseFromString(readFile("test.xml")),
  111 + elem = doc.documentElement,
  112 + ref_parent = elem.childNodes[1];
  113 +
  114 + ref_parent.insertBefore(doc.createElement("subtitle"), ref_parent.childNodes[7])
  115 + elem.normalize();
  116 + return diff(doc, fastxml.parseFromString(readFile("test3.xml")));
  117 +},
  118 +
  119 +test4 : function() {
  120 + var elem = fastxml.parseFromString(readFile("test.xml")).
  121 + documentElement,
  122 + ref_parent = elem.childNodes[1];
  123 +
  124 + try {
  125 + ref_parent.insertBefore(fastxml.parseFromString(readFile("test.xml")).
  126 + createElement("subtitle"), to.childNodes[7])
  127 + return false;
  128 + } catch (ex) {
  129 + return true;
  130 + }
  131 +},
  132 +
  133 +test5 : function() {
  134 + var doc = fastxml.parseFromString(readFile("test.xml")),
  135 + elem = doc.documentElement,
  136 + ref_parent = elem.childNodes[3];
  137 +
  138 + ref_parent.appendChild(elem.childNodes[1].childNodes[3]);
  139 + elem.normalize();
  140 + return diff(doc, fastxml.parseFromString(readFile("test5.xml")));
  141 +},
  142 +
  143 +test6 : function() {
  144 + var doc = fastxml.parseFromString(readFile("test.xml")),
  145 + elem = doc.documentElement,
  146 + ref_parent = elem.childNodes[1];
  147 +
  148 + ref_parent.appendChild(ref_parent.childNodes[3]);
  149 + elem.normalize();
  150 + return diff(doc, fastxml.parseFromString(readFile("test6.xml")));
  151 +},
  152 +
  153 +test7 : function() {
  154 + var doc = fastxml.parseFromString(readFile("test.xml")),
  155 + elem = doc.documentElement,
  156 + ref_parent = elem.childNodes[1];
  157 +
  158 + elem.normalize();
  159 + ref_parent.appendChild(ref_parent.childNodes[12]);
  160 + return diff(doc, fastxml.parseFromString(readFile("test7.xml")));
  161 +},
  162 +
  163 +test8 : function() {
  164 + var doc = fastxml.parseFromString(readFile("test.xml")),
  165 + elem = doc.documentElement,
  166 + to = elem.childNodes[1];
  167 +
  168 + to.appendChild(doc.createElement("subtitle"));
  169 + elem.normalize();
  170 + return diff(doc, fastxml.parseFromString(readFile("test8.xml")));
  171 +},
  172 +
  173 +test9 : function() {
  174 + var elem = fastxml.parseFromString(readFile("test.xml")).
  175 + documentElement,
  176 + ref_parent = elem.childNodes[1];
  177 +
  178 + try {
  179 + ref_parent.appendChild(fastxml.parseFromString(readFile("test.xml")).
  180 + createElement("subtitle"))
  181 + return false;
  182 + } catch (ex) {
  183 + return true;
  184 + }
  185 +},
  186 +
  187 +test10 : function() {
  188 + var doc = fastxml.parseFromString(readFile("test.xml")),
  189 + elem = doc.documentElement,
  190 + ref_parent = elem.childNodes[3];
  191 +
  192 + try {
  193 + ref_parent.insertBefore(elem, ref_parent.childNodes[3]);
  194 + return false;
  195 + } catch (ex) {
  196 + return true;
  197 + }
  198 +},
  199 +
  200 +test11 : function() {
  201 + var doc = fastxml.parseFromString(readFile("test.xml")),
  202 + elem = doc.documentElement,
  203 + ref_parent = elem.childNodes[3];
  204 +
  205 + try {
  206 + ref_parent.appendChild(elem);
  207 + return false;
  208 + } catch (ex) {
  209 + return true;
  210 + }
  211 +},
  212 +
  213 +test12 : function() {
  214 + var doc = fastxml.parseFromString(readFile("test.xml")),
  215 + elem = doc.documentElement,
  216 + ref_parent = elem.childNodes[3];
  217 +
  218 + try {
  219 + ref_parent.insertBefore(null, ref_parent.childNodes[3]);
  220 + return false;
  221 + } catch (ex) {
  222 + return true;
  223 + }
  224 +},
  225 +
  226 +test13 : function() {
  227 + var doc = fastxml.parseFromString(readFile("test.xml")),
  228 + elem = doc.documentElement,
  229 + ref_parent = elem.childNodes[3];
  230 + child = ref_parent.removeChild(ref_parent.childNodes[3]);
  231 +
  232 + elem.normalize();
  233 + return !child.parent
  234 + && diff(doc, fastxml.parseFromString(readFile("test13.xml")));
  235 +},
  236 +
  237 +test14 : function() {
  238 + return true; // turned off
  239 + var doc = fastxml.parseFromString(readFile("test.xml")),
  240 + elem = doc.documentElement,
  241 + ref_parent = elem.childNodes[3];
  242 +
  243 + ref_parent.removeChild(ref_parent.childNodes[3]);
  244 + try {
  245 + ref_parent.removeChild(child);
  246 + return false;
  247 + } catch (ex) {
  248 + return true;
  249 + }
  250 +},
  251 +
  252 +test15 : function() {
  253 + var doc = fastxml.parseFromString(readFile("test.xml")),
  254 + elem = doc.documentElement,
  255 + ref_parent = elem.childNodes[3];
  256 +
  257 + try {
  258 + ref_parent.removeChild(null);
  259 + return false;
  260 + } catch (ex) {
  261 + return true;
  262 + }
  263 +},
  264 +
  265 +test16 : function() {
  266 + var doc = fastxml.parseFromString(readFile("test.xml")),
  267 + elem = doc.getElementById("bk102");
  268 +
  269 + elem.normalize();
  270 + return elem.parentNode.nodeName == "catalog"
  271 + && diff(elem, fastxml.parseFromString(readFile("test16.xml")).
  272 + documentElement);
  273 +},
  274 +
  275 +test17 : function() {
  276 + var doc = fastxml.parseFromString(readFile("test.xml")),
  277 + elem = doc.getElementById("bk103");
  278 +
  279 + return !elem;
  280 +},
  281 +
  282 +test18 : function() {
  283 + var doc = fastxml.parseFromString(readFile("test.xml")),
  284 + elems = doc.getElementsByTagName("book"),
  285 + elem = elems[1];
  286 +
  287 + elem.normalize();
  288 + return elems.length = 2
  289 + && elem.parentNode.nodeName == "catalog"
  290 + && diff(elem, fastxml.parseFromString(readFile("test18.xml")).
  291 + documentElement);
  292 +},
  293 +
  294 +test19 : function() {
  295 + var doc = fastxml.parseFromString(readFile("test.xml")),
  296 + elems = doc.getElementsByTagName("shelf"),
  297 + elem = elems[0];
  298 +
  299 + return elems.length == 0
  300 + && !elem;
  301 +},
  302 +
  303 +test20 : function() {
  304 + var doc = fastxml.parseFromString(readFile("test.xml")),
  305 + elem = doc.documentElement.childNodes[3];
  306 +
  307 + return elem.getAttribute("id") == "bk102";
  308 +},
  309 +
  310 +test21 : function() {
  311 + var doc = fastxml.parseFromString(readFile("test.xml")),
  312 + elem = doc.documentElement.childNodes[3];
  313 +
  314 + return !elem.getAttribute("isbn");
  315 +},
  316 +
  317 +test22 : function() {
  318 + return true; // turned off
  319 + var doc = fastxml.parseFromString(readFile("test.xml")),
  320 + elem = doc.documentElement.childNodes[3];
  321 +
  322 + try {
  323 + elem.getAttribute("@id");
  324 + return false;
  325 + } catch (ex) {
  326 + return true;
  327 + }
  328 +},
  329 +
  330 +test23 : function() {
  331 + var doc = fastxml.parseFromString(readFile("test.xml")),
  332 + elem = doc.documentElement;
  333 + ref_parent = elem.childNodes[3];
  334 +
  335 + ref_parent.setAttribute("id", "bk103");
  336 + elem.normalize();
  337 + return diff(doc, fastxml.parseFromString(readFile("test23.xml")));
  338 +},
  339 +
  340 +test24 : function() {
  341 + var doc = fastxml.parseFromString(readFile("test.xml")),
  342 + elem = doc.documentElement;
  343 + ref_parent = elem.childNodes[3];
  344 +
  345 + ref_parent.setAttribute("isbn", "9783161484100");
  346 + elem.normalize();
  347 + return diff(doc, fastxml.parseFromString(readFile("test24.xml")));
  348 +},
  349 +
  350 +test25 : function() {
  351 + return true; // turned off
  352 + var doc = fastxml.parseFromString(readFile("test.xml")),
  353 + elem = doc.documentElement.childNodes[3];
  354 +
  355 + try {
  356 + elem.setAttribute("@id", "bk103");
  357 + return false;
  358 + } catch (ex) {
  359 + return true;
  360 + }
  361 +},
  362 +
  363 +test26 : function() {
  364 + var doc = fastxml.parseFromString(readFile("test.xml")),
  365 + attr = doc.createAttribute("isbn");
  366 +
  367 + attr.nodeValue = "9783161484100";
  368 + return attr.ownerDocument = doc
  369 + && !attr.parent
  370 + && attr.nodeType == attr.ATTRIBUTE
  371 + && attr.nodeName == "isbn"
  372 + && attr.nodeValue == "9783161484100";
  373 +},
  374 +
  375 +test27 : function() {
  376 + var doc = fastxml.parseFromString(readFile("test.xml")),
  377 + elem = doc.documentElement,
  378 + ref_parent = elem.childNodes[3],
  379 + attr = doc.createAttribute("isbn");
  380 +
  381 + attr.nodeValue = "9783161484100";
  382 + ref_parent.setAttributeNode(attr);
  383 + elem.normalize();
  384 + return diff(doc, fastxml.parseFromString(readFile("test27.xml")));
  385 +},
  386 +
  387 +test28 : function() {
  388 + var doc = fastxml.parseFromString(readFile("test.xml")),
  389 + elem = doc.documentElement,
  390 + ref_parent = elem.childNodes[3],
  391 + attr = ref_parent.getAttributeNode("id");
  392 +
  393 + ref_parent.setAttributeNode(attr);
  394 + elem.normalize();
  395 + return diff(doc, fastxml.parseFromString(readFile("test28.xml")));
  396 +},
  397 +
  398 +test29 : function() {
  399 + var doc = fastxml.parseFromString(readFile("test.xml")),
  400 + elem = doc.documentElement,
  401 + ref_parent = elem.childNodes[3],
  402 + attr = elem.childNodes[1].getAttributeNode("id");
  403 +
  404 + ref_parent.setAttributeNode(attr);
  405 + elem.normalize();
  406 + return diff(doc, fastxml.parseFromString(readFile("test29.xml")));
  407 +},
  408 +
  409 +test30 : function() {
  410 + var elem = fastxml.parseFromString(readFile("test.xml")).
  411 + documentElement,
  412 + ref_parent = elem.childNodes[3];
  413 +
  414 + try {
  415 + ref_parent.setAttributeNode(fastxml.parseFromString(readFile("test.xml")).
  416 + createAttribute("subtitle"))
  417 + return false;
  418 + } catch (ex) {
  419 + return true;
  420 + }
  421 +},
  422 +
  423 +test31 : function() {
  424 + var doc = fastxml.parseFromString(readFile("test.xml")),
  425 + elem = doc.createElement("element"),
  426 + attr = doc.createAttribute("attribute"),
  427 + text = doc.createTextNode("Lorem ipsum");
  428 + cdata = doc.createCDATASection("Lorem ipsum");
  429 + comment = doc.createComment("Lorem ipsum");
  430 +
  431 + return elem.nodeType == elem.ELEMENT && elem.nodeName == "element" && !elem.parent
  432 + && attr.nodeType == attr.ATTRIBUTE && attr.nodeName == "attribute" && !attr.parent
  433 + && text.nodeType == text.TEXT && text.nodeValue == "Lorem ipsum" && !text.parent
  434 + && cdata.nodeType == cdata.CDATA_SECTION && cdata.nodeValue == "Lorem ipsum" && !cdata.parent
  435 + && comment.nodeType == cdata.COMMENT && comment.nodeValue == "Lorem ipsum" && !comment.parent;
  436 +},
  437 +
  438 +test32 : function() {
  439 + var elem = fastxml.parseFromString(
  440 + readFile('xpath.xml')).documentElement,
  441 + expected = ['Everyday Italian','Harry Potter',
  442 + 'XQuery Kick Start','Learning XML'],
  443 + actual = [],
  444 + xpath = '/bookstore/book/title';
  445 +
  446 +
  447 + var selected = elem.selectNodes(xpath);
  448 + for (var i=0; i<selected.length; i++)
  449 + actual.push(selected[i].nodeValue);
  450 +
  451 + return check(expected, actual);
  452 +},
  453 +
  454 +test33 : function() {
  455 + var elem = fastxml.parseFromString(
  456 + readFile('xpath.xml')).documentElement,
  457 + expected = ['Everyday Italian'],
  458 + actual = [],
  459 + xpath = '/bookstore/book[1]/title';
  460 +
  461 +
  462 + var selected = elem.selectNodes(xpath);
  463 + for (var i=0; i<selected.length; i++)
  464 + actual.push(selected[i].nodeValue);
  465 +
  466 + return check(expected, actual);
  467 +},
  468 +
  469 +test34 : function() {
  470 + var elem = fastxml.parseFromString(
  471 + readFile('xpath.xml')).documentElement,
  472 + expected = [30.00,29.99,49.99,39.95],
  473 + actual = [],
  474 + xpath = '/bookstore/book/price/text()';
  475 +
  476 +
  477 + var selected = elem.selectNodes(xpath);
  478 + for (var i=0; i<selected.length; i++)
  479 + actual.push(selected[i].nodeValue);
  480 +
  481 + return check(expected, actual);
  482 +},
  483 +
  484 +test35 : function() {
  485 + var elem = fastxml.parseFromString(
  486 + readFile('xpath.xml')).documentElement,
  487 + expected = [49.99,39.95],
  488 + actual = [],
  489 + xpath = '/bookstore/book[price>35]/price ';
  490 +
  491 +
  492 + var selected = elem.selectNodes(xpath);
  493 + for (var i=0; i<selected.length; i++)
  494 + actual.push(selected[i].nodeValue);
  495 +
  496 + return check(expected, actual);
  497 +},
  498 +
  499 +test36 : function() {
  500 + var elem = fastxml.parseFromString(
  501 + readFile('xpath.xml')).documentElement,
  502 + expected = ['Everyday Italian','Harry Potter',
  503 + 'XQuery Kick Start','Learning XML'],
  504 + actual = [],
  505 + xpath = "descendant-or-self::node()[@lang='en']";
  506 +
  507 +
  508 + var selected = elem.selectNodes(xpath);
  509 + for (var i=0; i<selected.length; i++)
  510 + actual.push(selected[i].nodeValue);
  511 +
  512 + return check(expected, actual);
  513 +}
  514 +
  515 +};
  516 +
  517 +
  518 +for (var i in test) {
  519 +
  520 + if (test[i]())
  521 + console.log("test " + i + " succeeded\n");
  522 + else {
  523 + console.log("test " + i + " failed\n");
  524 + break;
  525 + }
  526 +}
22 test/test.xml
... ... @@ -0,0 +1,22 @@
  1 +<?xml version="1.0"?>
  2 +<catalog>
  3 + <book id="bk101">
  4 + <author>Gambardella, Matthew</author>
  5 + <title>XML Developer's Guide</title>
  6 + <genre>Computer</genre>
  7 + <price>44.95</price>
  8 + <publish_date>2000-10-01</publish_date>
  9 + <description>An in-depth look at creating applications
  10 + with XML.</description>
  11 + </book>
  12 + <book id="bk102">
  13 + <author>Ralls, Kim</author>
  14 + <title>Midnight Rain</title>
  15 + <genre>Fantasy</genre>
  16 + <price>5.95</price>
  17 + <publish_date>2000-12-16</publish_date>
  18 + <description>A former architect battles corporate zombies,
  19 + an evil sorceress, and her own childhood to become queen
  20 + of the world.</description>
  21 + </book>
  22 +</catalog>
22 test/test0.xml
... ... @@ -0,0 +1,22 @@
  1 +<?xml version="1.0"?>
  2 +<catalog>
  3 + <book id="bk101">
  4 + <author>Gambardella, Matthew</author>
  5 +
  6 + <genre>Computer</genre>
  7 + <price>44.95</price>
  8 + <publish_date>2000-10-01</publish_date>
  9 + <description>An in-depth look at creating applications
  10 + with XML.</description>
  11 + </book>
  12 + <book id="bk102">
  13 + <author>Ralls, Kim</author>
  14 + <title>XML Developer's Guide</title><title>Midnight Rain</title>
  15 + <genre>Fantasy</genre>
  16 + <price>5.95</price>
  17 + <publish_date>2000-12-16</publish_date>
  18 + <description>A former architect battles corporate zombies,
  19 + an evil sorceress, and her own childhood to become queen
  20 + of the world.</description>
  21 + </book>
  22 +</catalog>
22 test/test1.xml
... ... @@ -0,0 +1,22 @@
  1 +<?xml version="1.0"?>
  2 +<catalog>
  3 + <book id="bk101">
  4 + <author>Gambardella, Matthew</author>
  5 +
  6 + <genre>Computer</genre>
  7 + <title>XML Developer's Guide</title><price>44.95</price>
  8 + <publish_date>2000-10-01</publish_date>
  9 + <description>An in-depth look at creating applications
  10 + with XML.</description>
  11 + </book>
  12 + <book id="bk102">
  13 + <author>Ralls, Kim</author>
  14 + <title>Midnight Rain</title>
  15 + <genre>Fantasy</genre>
  16 + <price>5.95</price>
  17 + <publish_date>2000-12-16</publish_date>
  18 + <description>A former architect battles corporate zombies,
  19 + an evil sorceress, and her own childhood to become queen
  20 + of the world.</description>
  21 + </book>
  22 +</catalog>
22 test/test13.xml
... ... @@ -0,0 +1,22 @@
  1 +<?xml version="1.0"?>
  2 +<catalog>
  3 + <book id="bk101">
  4 + <author>Gambardella, Matthew</author>
  5 + <title>XML Developer's Guide</title>
  6 + <genre>Computer</genre>
  7 + <price>44.95</price>
  8 + <publish_date>2000-10-01</publish_date>
  9 + <description>An in-depth look at creating applications
  10 + with XML.</description>
  11 + </book>
  12 + <book id="bk102">
  13 + <author>Ralls, Kim</author>
  14 +
  15 + <genre>Fantasy</genre>
  16 + <price>5.95</price>
  17 + <publish_date>2000-12-16</publish_date>
  18 + <description>A former architect battles corporate zombies,
  19 + an evil sorceress, and her own childhood to become queen
  20 + of the world.</description>
  21 + </book>
  22 +</catalog>
10 test/test16.xml
... ... @@ -0,0 +1,10 @@
  1 +<book id="bk102">
  2 + <author>Ralls, Kim</author>
  3 + <title>Midnight Rain</title>
  4 + <genre>Fantasy</genre>
  5 + <price>5.95</price>
  6 + <publish_date>2000-12-16</publish_date>
  7 + <description>A former architect battles corporate zombies,
  8 + an evil sorceress, and her own childhood to become queen
  9 + of the world.</description>
  10 + </book>
10 test/test18.xml
... ... @@ -0,0 +1,10 @@
  1 +<book id="bk102">
  2 + <author>Ralls, Kim</author>
  3 + <title>Midnight Rain</title>
  4 + <genre>Fantasy</genre>
  5 + <price>5.95</price>
  6 + <publish_date>2000-12-16</publish_date>
  7 + <description>A former architect battles corporate zombies,
  8 + an evil sorceress, and her own childhood to become queen
  9 + of the world.</description>
  10 + </book>
22 test/test2.xml
... ... @@ -0,0 +1,22 @@
  1 +<?xml version="1.0"?>
  2 +<catalog>
  3 + <book id="bk101">
  4 + <author>Gambardella, Matthew</author>
  5 + <title>XML Developer's Guide</title>
  6 + <genre>Computer</genre>
  7 + <price>44.95</price>
  8 + <publish_date>2000-10-01</publish_date>
  9 + <description>An in-depth look at creating applications
  10 + with XML.</description>
  11 + </book>
  12 + <book id="bk102">
  13 + <author>Ralls, Kim</author>
  14 + <title>Midnight Rain</title>
  15 + <genre>Fantasy</genre>
  16 + <price>5.95</price>
  17 + <publish_date>2000-12-16</publish_date>
  18 + <description>A former architect battles corporate zombies,
  19 + an evil sorceress, and her own childhood to become queen
  20 + of the world.</description>
  21 + </book>
  22 +</catalog>
21 test/test23.xml
... ... @@ -0,0 +1,21 @@
  1 +<catalog>
  2 + <book id="bk101">
  3 + <author>Gambardella, Matthew</author>
  4 + <title>XML Developer's Guide</title>
  5 + <genre>Computer</genre>
  6 + <price>44.95</price>
  7 + <publish_date>2000-10-01</publish_date>
  8 + <description>An in-depth look at creating applications
  9 + with XML.</description>
  10 + </book>
  11 + <book id="bk103">
  12 + <author>Ralls, Kim</author>
  13 + <title>Midnight Rain</title>
  14 + <genre>Fantasy</genre>
  15 + <price>5.95</price>
  16 + <publish_date>2000-12-16</publish_date>
  17 + <description>A former architect battles corporate zombies,
  18 + an evil sorceress, and her own childhood to become queen
  19 + of the world.</description>
  20 + </book>
  21 +</catalog>
21 test/test24.xml
... ... @@ -0,0 +1,21 @@
  1 +<catalog>
  2 + <book id="bk101">
  3 + <author>Gambardella, Matthew</author>
  4 + <title>XML Developer's Guide</title>
  5 + <genre>Computer</genre>
  6 + <price>44.95</price>
  7 + <publish_date>2000-10-01</publish_date>
  8 + <description>An in-depth look at creating applications
  9 + with XML.</description>
  10 + </book>
  11 + <book id="bk102" isbn="9783161484100">
  12 + <author>Ralls, Kim</author>
  13 + <title>Midnight Rain</title>
  14 + <genre>Fantasy</genre>
  15 + <price>5.95</price>
  16 + <publish_date>2000-12-16</publish_date>
  17 + <description>A former architect battles corporate zombies,
  18 + an evil sorceress, and her own childhood to become queen
  19 + of the world.</description>
  20 + </book>
  21 +</catalog>
21 test/test27.xml
... ... @@ -0,0 +1,21 @@
  1 +<catalog>
  2 + <book id="bk101">
  3 + <author>Gambardella, Matthew</author>
  4 + <title>XML Developer's Guide</title>
  5 + <genre>Computer</genre>
  6 + <price>44.95</price>
  7 + <publish_date>2000-10-01</publish_date>
  8 + <description>An in-depth look at creating applications
  9 + with XML.</description>
  10 + </book>
  11 + <book id="bk102" isbn="9783161484100">
  12 + <author>Ralls, Kim</author>
  13 + <title>Midnight Rain</title>
  14 + <genre>Fantasy</genre>
  15 + <price>5.95</price>
  16 + <publish_date>2000-12-16</publish_date>
  17 + <description>A former architect battles corporate zombies,
  18 + an evil sorceress, and her own childhood to become queen
  19 + of the world.</description>
  20 + </book>
  21 +</catalog>
21 test/test28.xml
... ... @@ -0,0 +1,21 @@
  1 +<catalog>
  2 + <book id="bk101">
  3 + <author>Gambardella, Matthew</author>
  4 + <title>XML Developer's Guide</title>
  5 + <genre>Computer</genre>
  6 + <price>44.95</price>
  7 + <publish_date>2000-10-01</publish_date>
  8 + <description>An in-depth look at creating applications
  9 + with XML.</description>
  10 + </book>
  11 + <book id="bk102">
  12 + <author>Ralls, Kim</author>
  13 + <title>Midnight Rain</title>
  14 + <genre>Fantasy</genre>
  15 + <price>5.95</price>
  16 + <publish_date>2000-12-16</publish_date>
  17 + <description>A former architect battles corporate zombies,
  18 + an evil sorceress, and her own childhood to become queen
  19 + of the world.</description>
  20 + </book>
  21 +</catalog>
21 test/test29.xml
... ... @@ -0,0 +1,21 @@
  1 +<catalog>
  2 + <book>
  3 + <author>Gambardella, Matthew</author>
  4 + <title>XML Developer's Guide</title>
  5 + <genre>Computer</genre>
  6 + <price>44.95</price>
  7 + <publish_date>2000-10-01</publish_date>
  8 + <description>An in-depth look at creating applications
  9 + with XML.</description>
  10 + </book>
  11 + <book id="bk101">
  12 + <author>Ralls, Kim</author>
  13 + <title>Midnight Rain</title>
  14 + <genre>Fantasy</genre>
  15 + <price>5.95</price>
  16 + <publish_date>2000-12-16</publish_date>
  17 + <description>A former architect battles corporate zombies,
  18 + an evil sorceress, and her own childhood to become queen
  19 + of the world.</description>
  20 + </book>
  21 +</catalog>
22 test/test3.xml
... ... @@ -0,0 +1,22 @@
  1 +<?xml version="1.0"?>
  2 +<catalog>
  3 + <book id="bk101">
  4 + <author>Gambardella, Matthew</author>
  5 + <title>XML Developer's Guide</title>
  6 + <genre>Computer</genre>
  7 + <subtitle/><price>44.95</price>
  8 + <publish_date>2000-10-01</publish_date>
  9 + <description>An in-depth look at creating applications
  10 + with XML.</description>
  11 + </book>
  12 + <book id="bk102">
  13 + <author>Ralls, Kim</author>
  14 + <title>Midnight Rain</title>
  15 + <genre>Fantasy</genre>
  16 + <price>5.95</price>
  17 + <publish_date>2000-12-16</publish_date>
  18 + <description>A former architect battles corporate zombies,
  19 + an evil sorceress, and her own childhood to become queen
  20 + of the world.</description>
  21 + </book>
  22 +</catalog>
22 test/test5.xml
... ... @@ -0,0 +1,22 @@
  1 +<?xml version="1.0"?>
  2 +<catalog>
  3 + <book id="bk101">
  4 + <author>Gambardella, Matthew</author>
  5 +
  6 + <genre>Computer</genre>
  7 + <price>44.95</price>
  8 + <publish_date>2000-10-01</publish_date>
  9 + <description>An in-depth look at creating applications
  10 + with XML.</description>
  11 + </book>
  12 + <book id="bk102">
  13 + <author>Ralls, Kim</author>
  14 + <title>Midnight Rain</title>
  15 + <genre>Fantasy</genre>
  16 + <price>5.95</price>
  17 + <publish_date>2000-12-16</publish_date>
  18 + <description>A former architect battles corporate zombies,
  19 + an evil sorceress, and her own childhood to become queen
  20 + of the world.</description>
  21 + <title>XML Developer's Guide</title></book>
  22 +</catalog>
22 test/test6.xml
... ... @@ -0,0 +1,22 @@
  1 +<?xml version="1.0"?>
  2 +<catalog>
  3 + <book id="bk101">
  4 + <author>Gambardella, Matthew</author>
  5 +
  6 + <genre>Computer</genre>
  7 + <price>44.95</price>
  8 + <publish_date>2000-10-01</publish_date>
  9 + <description>An in-depth look at creating applications
  10 + with XML.</description>
  11 + <title>XML Developer's Guide</title></book>
  12 + <book id="bk102">
  13 + <author>Ralls, Kim</author>
  14 + <title>Midnight Rain</title>
  15 + <genre>Fantasy</genre>
  16 + <price>5.95</price>
  17 + <publish_date>2000-12-16</publish_date>
  18 + <description>A former architect battles corporate zombies,
  19 + an evil sorceress, and her own childhood to become queen
  20 + of the world.</description>
  21 + </book>
  22 +</catalog>
21 test/test7.xml
... ... @@ -0,0 +1,21 @@
  1 +<catalog>
  2 + <book id="bk101">
  3 + <author>Gambardella, Matthew</author>
  4 + <title>XML Developer's Guide</title>
  5 + <genre>Computer</genre>
  6 + <price>44.95</price>
  7 + <publish_date>2000-10-01</publish_date>
  8 + <description>An in-depth look at creating applications
  9 + with XML.</description>
  10 + </book>
  11 + <book id="bk102">
  12 + <author>Ralls, Kim</author>
  13 + <title>Midnight Rain</title>
  14 + <genre>Fantasy</genre>
  15 + <price>5.95</price>
  16 + <publish_date>2000-12-16</publish_date>
  17 + <description>A former architect battles corporate zombies,
  18 + an evil sorceress, and her own childhood to become queen
  19 + of the world.</description>
  20 + </book>
  21 +</catalog>
21 test/test8.xml
... ... @@ -0,0 +1,21 @@
  1 +<catalog>
  2 + <book id="bk101">
  3 + <author>Gambardella, Matthew</author>
  4 + <title>XML Developer's Guide</title>
  5 + <genre>Computer</genre>
  6 + <price>44.95</price>
  7 + <publish_date>2000-10-01</publish_date>
  8 + <description>An in-depth look at creating applications
  9 + with XML.</description>
  10 + <subtitle/></book>
  11 + <book id="bk102">
  12 + <author>Ralls, Kim</author>
  13 + <title>Midnight Rain</title>
  14 + <genre>Fantasy</genre>
  15 + <price>5.95</price>
  16 + <publish_date>2000-12-16</publish_date>
  17 + <description>A former architect battles corporate zombies,
  18 + an evil sorceress, and her own childhood to become queen
  19 + of the world.</description>
  20 + </book>
  21 +</catalog>
37 test/xpath.xml
... ... @@ -0,0 +1,37 @@
  1 +<?xml version="1.0" encoding="ISO-8859-1"?>
  2 +
  3 +<bookstore>
  4 +
  5 +<book category="COOKING">
  6 + <title lang="en">Everyday Italian</title>
  7 + <author>Giada De Laurentiis</author>
  8 + <year>2005</year>
  9 + <price>30.00</price>
  10 +</book>
  11 +
  12 +<book category="CHILDREN">
  13 + <title lang="en">Harry Potter</title>
  14 + <author>J K. Rowling</author>
  15 + <year>2005</year>
  16 + <price>29.99</price>
  17 +</book>
  18 +
  19 +<book category="WEB">
  20 + <title lang="en">XQuery Kick Start</title>
  21 + <author>James McGovern</author>
  22 + <author>Per Bothner</author>
  23 + <author>Kurt Cagle</author>
  24 + <author>James Linn</author>
  25 + <author>Vaidyanathan Nagarajan</author>
  26 + <year>2003</year>
  27 + <price>49.99</price>
  28 +</book>
  29 +
  30 +<book category="WEB">
  31 + <title lang="en">Learning XML</title>
  32 + <author>Erik T. Ray</author>
  33 + <year>2003</year>
  34 + <price>39.95</price>
  35 +</book>
  36 +
  37 +</bookstore>

0 comments on commit f1101a4

Please sign in to comment.
Something went wrong with that request. Please try again.