oozcitak / xmlbuilder-js

An XML builder for node.js
MIT License
921 stars 110 forks source link

Add custom xmldec attributes #166

Closed pablozandona closed 7 years ago

pablozandona commented 7 years ago

I'm not seeing any way to add a custom attributes to <?xml> node, like:

<?xml version="1.0" encoding="UTF-8" foo="bar"?>

In documentation there are 3 predefined attributes: 'version', 'encoding' and 'standalone'.

oozcitak commented 7 years ago

There is no way of adding custom attributes to the XML declaration because that would be invalid XML. Only version, encoding and standalone are allowed in the declaration. See: https://www.w3.org/TR/xml11/#sec-prolog-dtd