mirror of https://github.com/svaarala/duktape.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
480 B
28 lines
480 B
var xmldata =
|
|
'<test>' +
|
|
'<foo attr="123">' +
|
|
'Content & stuff' +
|
|
'</foo>' +
|
|
'<foo attr="124">' +
|
|
'Second child' +
|
|
'</foo>' +
|
|
'<foo attr="125">' +
|
|
'Third child' +
|
|
'</foo>' +
|
|
'</test>';
|
|
|
|
print('=== input xml data')
|
|
print(xmldata);
|
|
|
|
print('=== parsing')
|
|
var doc = new XmlDocument(xmldata)
|
|
print(typeof doc);
|
|
|
|
print('=== pretty printed')
|
|
print(doc)
|
|
|
|
print('=== loop over "foo" children')
|
|
doc.eachChild(function (x) {
|
|
print(Duktape.enc('jx', x));
|
|
print(x);
|
|
});
|
|
|