docs(xml-rpc): don't normalize or trim whitespaces when parsing XML

This commit is contained in:
Julien Fontanet
2024-10-24 11:21:20 +02:00
parent bc5fa0f3f5
commit c79efa0fe8
2 changed files with 4 additions and 2 deletions

View File

@@ -121,7 +121,8 @@ const xml = `
</methodResponse>
`
const tree = parseXml(xml)
// do not normalize or trim whitespaces as it will break string values
const tree = parseXml(xml, { normalize: false, trim: false })
// it can now be passed to the XML-RPC parser
xmlRpcParser.parse(tree)

View File

@@ -139,7 +139,8 @@ const xml = `
</methodResponse>
`
const tree = parseXml(xml)
// do not normalize or trim whitespaces as it will break string values
const tree = parseXml(xml, { normalize: false, trim: false })
// it can now be passed to the XML-RPC parser
xmlRpcParser.parse(tree)