diff --git a/apps/tests/xml-declaration/xml-declaration-tests.ts b/apps/tests/xml-declaration/xml-declaration-tests.ts
index af75ae7bf..e184ce1c3 100644
--- a/apps/tests/xml-declaration/xml-declaration-tests.ts
+++ b/apps/tests/xml-declaration/xml-declaration-tests.ts
@@ -481,17 +481,25 @@ export function test_parse_ShouldParseNestedListViewInListViewTemplate() {
export function test_parse_NestedRepeaters() {
var pageXML =
"" +
- " " +
- " " +
- " " +
- " " +
- " " +
- " " +
- " " +
- " " +
- " " +
- " " +
- " " +
+ " " +
+ " " +
+ " " +
+ " " +
+ " " +
+ " " +
+ " " +
+ " " +
+ " " +
+ " " +
+ " " +
+ " " +
+ " " +
+ " " +
+ " " +
+ " " +
+ " " +
+ " " +
+ " " +
"";
var p = builder.parse(pageXML);
diff --git a/ui/builder/builder.ts b/ui/builder/builder.ts
index 40b747595..f3f98cd5a 100644
--- a/ui/builder/builder.ts
+++ b/ui/builder/builder.ts
@@ -77,14 +77,20 @@ function parseInternal(value: string, context: any): componentBuilder.ComponentM
if (templateBuilder) {
if (args.eventType === xml.ParserEventType.StartElement) {
templateBuilder.addStartElement(args.prefix, args.namespace, args.elementName, args.attributes);
+ return;
} else if (args.eventType === xml.ParserEventType.EndElement) {
templateBuilder.addEndElement(args.prefix, args.elementName);
if (templateBuilder.hasFinished()) {
templateBuilder.build();
templateBuilder = undefined;
}
+ else {
+ return;
+ }
+ }
+ else {
+ return;
}
- return;
}
// Get the current parent.