Closed Faizan2030 closed 1 month ago
We're glad you find this project helpful. We'll try to address this issue ASAP. You can vist https://solothought.com to know recent features. Don't forget to star this repo.
Can you please share the intermediate json object?
defaultXmlOptions: {
ignoreAttributes: false,
attributeNamePrefix: "@_",
indentBy: " ",
textNodeName: "#text",
format: true,
},
var testJson = { component: {
"internal-name": {
"#text": "test test > 14",
"@_tokenized": true
}
}}
got your problem. "@_tokenized": true
this is set as boolean. Can you try to set it as string?
Just tried this setting it as a string changes nothing. What you can do however is to add this property to your options and the original should work
suppressBooleanAttributes: false
Also see #611
closing the issue. feel free to reopen if still exist. Please also check for v5
Description
I need to include xml attribute, like this :
<internal-name tokenized="true">test test > 14</internal-name>
Input
Code
Here is the code that converts:
That attribute should have ="true"
Output
expected data
Would you like to work on this issue?
I posted the question here as well https://stackoverflow.com/questions/78354831/how-to-include-attribute-value-while-building-xml-using-fast-xml-parser