From 4513442e8aae54452f43a1d434a4c16728e77386 Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Wed, 10 Apr 2013 21:15:12 +0100 Subject: Map namespaces of attributes --- tests/xmlreader.tests.js | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'tests/xmlreader.tests.js') diff --git a/tests/xmlreader.tests.js b/tests/xmlreader.tests.js index 7f4ca9d..2eb95c8 100644 --- a/tests/xmlreader.tests.js +++ b/tests/xmlreader.tests.js @@ -53,6 +53,16 @@ describe('xmlreader.read', function() { assert.deepEqual(result.root.name, "x:body"); }); }) + + test('namespace of attributes is mapped to prefix', function() { + var namespaceMap = { + "word": "x" + }; + var xmlString = ''; + return xmlreader.read(xmlString, namespaceMap).then(function(result) { + assert.deepEqual(result.root.attributes["x:val"], "Hello!"); + }); + }) test('can find first element with name', function() { return xmlreader.read('').then(function(result) { -- cgit v1.2.3