xmlforall
Simple, fast and reliable Nodejs XML parser.
var xmlforall = ;xmlforall;
Element
Object returned by the parse function.
Methods
getElementsByTagName(tagName)
Returns a list of Elements matching the tagName.
getElementById(id)
Returns the first matching Element with that id.
getAttribute(attr)
Returns a string attribute attr
Properties
tagName
Tag name of the element.
text
The text value of the element.
attributes
A string array of all the element attributes.
Examples
var xmlforall = ;xmlforall;
var xmlforall = ;xmlforall;
menu.xml
<!-- https://www.w3schools.com/xml/ --> Belgian Waffles $5.95 Two of our famous Belgian Waffles with plenty of real maple syrup 650 Strawberry Belgian Waffles $7.95 Light Belgian waffles covered with strawberries and whipped cream 900 Berry-Berry Belgian Waffles $8.95 Belgian waffles covered with assorted fresh berries and whipped cream 900 French Toast $4.50 Thick slices made from our homemade sourdough bread 600 Homestyle Breakfast $6.95 Two eggs, bacon or sausage, toast, and our ever-popular hash browns 950
Installation
$ npm install xmlforall --save
Features
- XML Parser
- Window.document like interface
- Asynchronous
- Only dependency is SAX
Test
cd node_modules/xmlforall/node test/test.jsORnpm test
License
Have fun!