You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, I couldn't find any option to preserve whitespace for doc.end or convert functions, so I thought I'd try here.
In my xmlString, there's a property containing only whitespace values.
XML: <ValueWithBlankSpaces> </ValueWithBlankSpaces>
When I convert it to JSON using doc.end() or convert(), the value becomes an empty object.
const doc = create(xmlString);
const jsonString = doc.end({ format: "json" });
JSON: "ValueWithBlankSpaces": {}
Is there an option I can use to preserve the whitespace(s)?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Hello, I couldn't find any option to preserve whitespace for doc.end or convert functions, so I thought I'd try here.
In my xmlString, there's a property containing only whitespace values.
XML:
<ValueWithBlankSpaces> </ValueWithBlankSpaces>When I convert it to JSON using doc.end() or convert(), the value becomes an empty object.
const doc = create(xmlString);
const jsonString = doc.end({ format: "json" });
JSON:
"ValueWithBlankSpaces": {}Is there an option I can use to preserve the whitespace(s)?
All reactions