Skip to content

Instantly share code, notes, and snippets.

@Heavyblade
Created June 22, 2020 20:00
Show Gist options
  • Save Heavyblade/b24d2664f47dfc665e8564fb7c3a3ce0 to your computer and use it in GitHub Desktop.
Save Heavyblade/b24d2664f47dfc665e8564fb7c3a3ce0 to your computer and use it in GitHub Desktop.
cirrus_xml.js
var xmlDocument = CirrusXML.xmlParser("XXXXXXXX TU XML AQUI XXXXXXXX");
// Busco un node que tenga el nombre "code"
code = xmlDocument.find({nodeName: 'code'})[0];
// Busco un node que tenga el nombre "error"
error = xmlDocument.find({nodeName: 'error'})[0];
codeContent = code.getText(); // Obtiene texto que esta dentro de <code> ... texto ... </code>
errorContent = error.getText(); // Obtiene texto que esta dentro de <error> ... texto ... </error>
alert(codeContent);
alert(errorContent);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment