Sie können diese Vorlage verwenden, um XML in/aus JSON zu konvertieren.
XML in JSON konvertieren
Simplifier.Util.xml2json(xml: string): string
Analysiert eine XML-Zeichenfolge, konvertiert sie in JSON und gibt die darstellende JSON-Zeichenfolge zurück.
try{
var convertedJson = Simplifier.Util.xml2json(" ");
output.json = convertedJson;
output.message = "Konvertierung erfolgreich";
output.success = true;
} catch (e) {
output.message = e.message;
output.success = false;
}
JSON in XML konvertieren
Simplifier.Util.json2xml(json: string): string
Analysiert eine JSON-Zeichenfolge, konvertiert sie in XML und gibt die darstellende XML-Zeichenfolge zurück.
try{
var convertedXML = Simplifier.Util.json2xml(JSON.stringify( {attribute: "value"}));
output.xml = convertedXML;
output.message = "Konvertierung erfolgreich";
output.success = true;
} catch (e) {
output.message = e.message;
output.success = false;
}











