-
Notifications
You must be signed in to change notification settings - Fork 596
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Invalid character in name - buildObject #639
Comments
Solucionado, primero se agregan todas las etiquetas que se necesitan y se agregan poco a poco las vacias[]. |
Translation: Solved, first all the tags that are needed are added and the empty ones[] are added little by little. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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: