Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
contentConverter = function (c) {
c = convertToString(c);
if (null !== c) {
var isValidXml = true;
var xmlParser = new Xml.XmlParser(function () { }, function (error) {
isValidXml = false;
});
xmlParser.parse(c);
if (!isValidXml) {
throw "XML parse error.";
}
}
return c;
};
break;
function parseInternal(value, exports) {
var rootComponentModule;
var parents = new Array();
var complexProperties = new Array();
var templateBuilder;
var xmlParser = new xml.XmlParser(function (args) {
if (templateBuilder) {
if (args.eventType === xml.ParserEventType.StartElement) {
templateBuilder.addStartElement(args.prefix, args.namespace, args.elementName, args.attributes);
}
else if (args.eventType === xml.ParserEventType.EndElement) {
if (templateBuilder.elementName !== args.elementName) {
templateBuilder.addEndElement(args.prefix, args.elementName);
}
else {
templateBuilder.build();
templateBuilder = undefined;
}
}
}
var parent = parents[parents.length - 1];
var complexProperty = complexProperties[complexProperties.length - 1];
function parseInternal(value, exports) {
var rootComponentModule;
var parents = new Array();
var complexProperties = new Array();
var templateBuilder;
var xmlParser = new xml.XmlParser(function (args) {
if (templateBuilder) {
if (args.eventType === xml.ParserEventType.StartElement) {
templateBuilder.addStartElement(args.prefix, args.namespace, args.elementName, args.attributes);
}
else if (args.eventType === xml.ParserEventType.EndElement) {
if (templateBuilder.elementName !== args.elementName) {
templateBuilder.addEndElement(args.prefix, args.elementName);
}
else {
templateBuilder.build();
templateBuilder = undefined;
}
}
}
var parent = parents[parents.length - 1];
var complexProperty = complexProperties[complexProperties.length - 1];
function parseInternal(value, context) {
var currentPage;
var rootComponentModule;
var parents = new Array();
var complexProperties = new Array();
var templateBuilder;
var currentPlatformContext;
var xmlParser = new xml.XmlParser(function (args) {
if (args.eventType === xml.ParserEventType.StartElement) {
if (isPlatform(args.elementName)) {
if (currentPlatformContext) {
throw new Error("Already in '" + currentPlatformContext + "' platform context and cannot switch to '" + args.elementName + "' platform! Platform tags cannot be nested.");
}
currentPlatformContext = args.elementName;
return;
}
}
if (args.eventType === xml.ParserEventType.EndElement) {
if (isPlatform(args.elementName)) {
currentPlatformContext = undefined;
return;
}
}
if (currentPlatformContext && !isCurentPlatform(currentPlatformContext)) {
function parse(xml, processNamespaces, angularSyntax) {
var doc = new XDocument();
var errors = [];
var elementStack = [];
var currentContainer = function () { return elementStack.length > 0 ? elementStack[elementStack.length - 1] : doc; };
var xParser = new Xml.XmlParser(function (e) {
var c = currentContainer();
if (e.eventType === Xml.ParserEventType.StartElement) {
var newElement = new XElement(e.elementName);
newElement.add(e.data);
var attribs = getOwnProperties(e.attributes);
if (!TypeUtils.isNullOrUndefined(attribs)) {
for (var p in attribs) {
var a = new XAttribute(p);
a.value = attribs[p];
newElement.add(a);
}
}
currentContainer().add(newElement);
elementStack.push(newElement);
}
else if (e.eventType === Xml.ParserEventType.Text) {
XmlStringParser.prototype.parse = function (value) {
var _this = this;
var xmlParser = new xml.XmlParser(function (args) {
try {
_this.next(args);
}
catch (e) {
throw _this.error(e, args.position);
}
}, function (e, p) {
throw _this.error(e, p);
}, true);
if (types_1.isString(value)) {
xmlParser.parse(value);
}
};
return XmlStringParser;
XmlStringParser.prototype.parse = function (value) {
var _this = this;
var xmlParser = new xml.XmlParser(function (args) {
try {
_this.next(args);
}
catch (e) {
throw _this.error(e, args.position);
}
}, function (e, p) {
throw _this.error(e, p);
}, true);
if (types_1.isString(value)) {
xmlParser.parse(value);
}
};
return XmlStringParser;
XmlStringParser.prototype.parse = function (value) {
var _this = this;
var xmlParser = new xml.XmlParser(function (args) {
try {
_this.next(args);
}
catch (e) {
throw _this.error(e, args.position);
}
}, function (e, p) {
throw _this.error(e, p);
}, true);
if (types_1.isString(value)) {
xmlParser.parse(value);
}
};
return XmlStringParser;