Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export function loadTableauPlan(graphString, graphCollapse) {
var result;
var parser = new XmlParser({
explicitRoot: false,
explicitChildren: true,
preserveChildrenOrder: true,
// Don't merge attributes. XML attributes will be stored in node["$"]
mergeAttrs: false
});
parser.parseString(graphString, function(err, parsed) {
if (err) {
result = {error: "XML parse failed with '" + err + "'."};
} else {
var root = prepareTreeData(parsed, graphCollapse);
var crosslinks = addCrosslinks(root);
result = {root: root, crosslinks: crosslinks};
}
});
return result;
export function loadXml(graphString, _graphCollapse) {
var result;
var parser = new XmlParser({
explicitRoot: false,
explicitChildren: true,
preserveChildrenOrder: true,
// Don't merge attributes. XML attributes will be stored in node["$"]
mergeAttrs: false
});
parser.parseString(graphString, function(err, parsed) {
if (err) {
result = {error: "XML parse failed with '" + err + "'."};
} else {
result = {root: convertJSON(parsed)};
}
});
return result;
}