////////////////////CONFIGURACION
var allOpen=false;
////////////////////////////////////////////
var contenedor=$("#XML");
var template=$("#tNodo").html();
var templateAttr=$("#atributos").html();
var url="https://api.npoint.io/5291950cd6dc3ef07487";
$.getJSON(url, function( data ){
var COMPLEMENTOS=data.CFDI.COMPLEMENTOS;
for(var i in COMPLEMENTOS){//SE RECORREN LOS COMPLEMENTOS
var complemento=COMPLEMENTOS[i];
var htmlTemplate=template.replace("{NOMBRE}",complemento.NOMBRE);
var version="";
if(complemento.hasOwnProperty("VERSION")){
version=complemento.VERSION+"v";
}
htmlTemplate=htmlTemplate.replace("{IDBODY}",i);
htmlTemplate=htmlTemplate.replace("{IDBODY2}",i);
htmlTemplate=htmlTemplate.replace("{VERSION}",version);
htmlTemplate=htmlTemplate.replace("{DESCRIPCION}",complemento.DESCRIPCION);
////////////// ATRIBUTOS DEL COMPLEMENTO
var listaAtributos="";
if(complemento.hasOwnProperty("ATRIBUTOS")){
var atributos=complemento.ATRIBUTOS;
//console.log("BATMAN",atributos);
for(var x in atributos){
var atributo=atributos[x];
var valoresRemplazables=["{NOMBRE}",
"{NOMBRE}",
"{NODO}",
"{ATTRIBUTO}",
"{NODO}",
"{ATTRIBUTO}"];
var valoresReales=[atributo.NOMBRE,
atributo.NOMBRE,
complemento.NOMBRE.trim().replace(/ /g,''),
atributo.NOMBRE.trim().replace(/ /g,''),
complemento.NOMBRE.trim().replace(/ /g,''),
atributo.NOMBRE.trim().replace(/ /g,'')];
var indicaciones=atributo.INDICACIONES;
var indicaciones_completas=$("<div/>");
var table_indicaciones=$("<table/>");
table_indicaciones.addClass("table");
var tr=$("<tr/>");
var...
Please Whitelist JSFiddle in your content blocker.
Help keep JSFiddle free for always by one of two ways:
Whitelist JSFiddle in your content blocker (two clicks)
Go PRO and get access to additional PRO features →
Join the 4+ million users, and keep the JSFiddle dream alive.
Ad-free
All ads in the editor and listing pages are turned completely off.
Use pre-released features
You get to try and use features (like the Palette Color Generator) months before everyone else.
Fiddle collections
Sort and categorize your Fiddles into multiple collections.
Private collections and fiddles
You can make as many Private Fiddles, and Private Collections as you wish!
Console
Debug your Fiddle with a minimal built-in JavaScript console.