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
Hi Leonidas,
I have a problem when trying to convert a json to xml.
the "Invoice" tag needs to be an array since I will dynamically add more of the same elements.
var builder = new xml2js.Builder( { headless: false, renderOpts: { pretty: true } ,xmldec: {version: "1.0"}});
var xml = builder.buildObject(JsonFact);
then throw the message "Invalid character in name --> $ "
Could you please guide me how to solve it, thanks Leonidas.
The text was updated successfully, but these errors were encountered:
Hi Leonidas,
I have a problem when trying to convert a json to xml.
the "Invoice" tag needs to be an array since I will dynamically add more of the same elements.
var JsonFact = {
'Invoice':[{
'$' : {
"listURI":"urn:pe:gob:sunat:cpe:see:catalogos:catalogo01",
"listName":"Tipo de Documento",
"listAgencyName": "PE:SUNAT",
"listID":"0101"
}
},
"cbc:item":"1",
"cbc:item":"2",
"cbc:item":"3"
]
};
//JsonFact =JsonFact.Invoice.push({"cbc:item":"4"});
//JsonFact =JsonFact.Invoice.push({"cbc:item":"5"});
var builder = new xml2js.Builder( { headless: false, renderOpts: { pretty: true } ,xmldec: {version: "1.0"}});
var xml = builder.buildObject(JsonFact);
then throw the message "Invalid character in name --> $ "
Could you please guide me how to solve it, thanks Leonidas.
The text was updated successfully, but these errors were encountered: