Closed Jasperrr91 closed 2 years ago
I'm glad you find this repository helpful. I'll try to address your issu ASAP. You can watch the repo for new changes or star it.
This works fine for me
const XMLdata = `
<car>
<color alpha="7">purple</color>
<type>minivan</type>
<registration>2020-02-03</registration>
<capacity>7</capacity>
</car>`;
const options = {
ignoreAttributes: false,
attributeNamePrefix: "",
attributesGroupName: "@@",
format: true
};
const parser = new XMLParser(options);
let result = parser.parse(XMLdata);
console.log(JSON.stringify(result, null,4));
const builder = new XMLBuilder(options);
const output = builder.build(result);
console.log(output);
Please reopen the issue if still exists
Checklist
Code
\Note: parserOptions.xml and parserOptions.json are equal to the sample configurations
Output
expected data
The issues seems to be that if
this.options.attrNodeName
is set (which it is, because the attributes are grouped under the defaultattr
key) the entire prefix gets ignored.Would you like to work on this issue?
Bookmark this repository for further updates.