06-25-2014 10:06 AM
<?xml version="1.0" encoding="UTF-8"?>
<nfeProc xmlns="http://www.portalfiscal.inf.br/nfe" versao="2.00">
<NFe xmlns="http://www.portalfiscal.inf.br/nfe">
<infNFe versao="2.00" Id="NFe35140404108518000102550020000957691354988086">
<ide>
…
</ide>
…
</infNFe>
…
</NFe>
…
</nfeProc>
var content = new XML(node.content.replaceAll("(?s)<\\?xml .*?\\?>\\s*", ""));
<nfeProc>
<NFe>
<infNFe>
//Remove first line
document.content.replaceAll("(?s)<\\?xml .*?\\?>\\s*", "");
var fileContent = new XML(document);
//Remove nfeproc xmls
document.content.replaceAll("(?s)<\\?nfeProc xmlns .*?\\?>\\s*", "<nfeProc>"); //I got this result: <nfeProc versao="2.00">
//Remove nfe xmls
document.content.replaceAll("(?s)<\\?NFe xmlns .*?\\?>\\s*", "<NFe>"); //It works fine: <NFe>
//Remove infNFe Id
document.content.replaceAll("(?s)<\\?infNFe Id .*?\\?>\\s*", "<infNFe>"); //Do not work
06-25-2014 10:13 AM
06-25-2014 06:30 PM
document.content.replaceAll("(?s)<\\?xml .*?\\?>\\s*", "");
document.content.content= document.content.content.replaceAll("(?s)\\s*", "");
document.save();
document.content.replaceAll("(?s)<\\?xml .*?\\?>\\s*", "");
document.content.content.replaceAll("(?s)\\s*", "");
document.save();
document.content.replaceAll("(?s)<\\?xml .*?\\?>\\s*", "");
document.content.content= document.content.content.replaceAll("(?s)\\s*", "");
document.save();
var fileContent = new XML(document);
var fileContent = new XML(document.content.replaceAll("(?s)<\\?xml .*?\\?>\\s*", ""));
var fileContent2 = new XML(fileContent.content.content.replaceAll("(?s)\\s*", ""));
06-25-2014 12:16 PM
var content = new xml(fileContent);
delete content.@xmlns; //delete nfeProc xmlns attribute
delete content.infNFe.@versao // delete infNFe versao attribte
06-25-2014 06:43 PM
<nfeProc versao="2.00">
<NFe>
<infNFe Id="NFe35140404108518000102550020000957691354988086" versao="2.00">
<nfeProc>
<NFe>
<infNFe>
06-25-2014 10:48 PM
var fileContent = document.content;
var xml = new XML(fileContent);
var nfe = xml.child(0);
var infNFe= nfe.child(0);
delete infNFe.@versao; // delete infNFe versao attribte
delete infNFe.@Id;
delete nfe.@xmlns;
delete xml.@versao; //delete nfeProc versao attribute
delete xml.@xmlns; //delete nfeProc xmlns attribute
06-26-2014 11:44 AM
06-26-2014 08:10 PM
07-03-2014 09:25 AM
var fileContent = document.content;
var xml = new XML(fileContent);
var nfe = xml.child(0);
var infNFe= nfe.child(0);
delete infNFe.@versao; // delete infNFe versao attribte
delete infNFe.@Id;
delete nfe.@xmlns;
delete xml.@versao; //delete nfeProc versao attribute
delete xml.@xmlns; //delete nfeProc xmlns attribute
logger.getSystem().out("#### XML CONTENT ##### " + xml);
var cnpj = xml.NFe.infNFe.dest.CNPJ;
logger.getSystem().out("#### CNPJ value is #### " +cnpj);
07-11-2014 03:10 PM
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.