diff --git a/src/linter/xmlTemplate/Parser.ts b/src/linter/xmlTemplate/Parser.ts index 4fd7561f4..b598214ac 100644 --- a/src/linter/xmlTemplate/Parser.ts +++ b/src/linter/xmlTemplate/Parser.ts @@ -168,14 +168,14 @@ export default class Parser { } popTag(_tag: SaxTag) { // No need to use the parsed tag, we rely on our nodeStack - const level = this.#nodeStack.length; const closingNode = this.#nodeStack.pop(); + const level = this.#nodeStack.length; if (closingNode && (closingNode.kind & (NodeKind.Control | NodeKind.FragmentDefinition))) { // Generate view code for this control // If this is the root control, export it - if (level === 1) { + if (level === 0) { // Actually closingNode might be a FragmentDefinitionDeclaration here // But that's tricky with the current generator signatures this.#generator.writeRootControl(closingNode as ControlDeclaration); diff --git a/test/fixtures/linter/rules/NoDeprecatedApi/MultipleXmlns.fragment.xml b/test/fixtures/linter/rules/NoDeprecatedApi/MultipleXmlns.fragment.xml new file mode 100644 index 000000000..96c3e3582 --- /dev/null +++ b/test/fixtures/linter/rules/NoDeprecatedApi/MultipleXmlns.fragment.xml @@ -0,0 +1,11 @@ + + + + +
+ +