node-xml icon indicating copy to clipboard operation
node-xml copied to clipboard

XML namespace

Open tin-dao opened this issue 11 years ago • 3 comments

Is there any way to create a xml element with namespace? For example:

<root xmlns:h="http://www.w3.org/TR/html4/">
  <h:table>My table</h:table>
</root>

tin-dao avatar Oct 18 '14 10:10 tin-dao

You can use _attr for namespaces. Example:

[{
    "root": [{
        "_attr": {
            "xmlns:h": "http://www.w3.org/TR/html4/"
        }
    }, {
        "h:table": "My table"
    }]
}]

I hope it helps and it's not too late.

maxnowack avatar Nov 12 '14 21:11 maxnowack

Could you describe it in readme?

izatop avatar Jul 09 '15 10:07 izatop

1.0.1 last npm publish 31/01/2016 with 8 pending PR not moving since years. I would have add more example but this repo seems frozen :/ (anyway thanks for this lib ! 👍 😄 )

boly38 avatar Nov 24 '23 20:11 boly38