michaelkourlas / node-js2xmlparser

Popular Node.js module for parsing JavaScript objects into XML
https://www.npmjs.org/package/js2xmlparser
Apache License 2.0
221 stars 52 forks source link

Can add envelop for generated xml, Please help me to do. #55

Closed khajaamin closed 5 years ago

khajaamin commented 7 years ago

Using this lib I did generated xml

I wan to add

this at beginning and at End. Please help.
michaelkourlas commented 6 years ago

I'm not sure I understand what you're asking. Can't you add the soap information to the object you're converting, or manually add it to the XML after converting?

ziplokk1 commented 6 years ago

71 Should fix what you're asking for.

michaelkourlas commented 5 years ago

Assuming attributes in the root element is what you're asking for, js2xmlparser already supports this:

> js2xmlparser.parse("root", {"@": {"abc": "def"}})
'<?xml version=\'1.0\'?>\n<root abc=\'def\'/>'