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

Provide example for mixed content #53

Closed raffazizzi closed 7 years ago

raffazizzi commented 7 years ago

Could you provide an example (and/or test) of how mixed content should be represented?

For example:

<el1>text1<el2>text2</el2>text3</el1>
michaelkourlas commented 7 years ago

The following object should produce the desired output:

{
    el1: {
        "#1": "text1",
        el2: "text2",
        "#2": "text3"
    }
}

I believe example 5 already demonstrates this feature (multiple value entries).