protected override QilNode VisitNamespaceDecl(QilBinary ndNmsp) {
XmlILConstructInfo info = XmlILConstructInfo.Read(ndNmsp);
bool callChk;
Debug.Assert(info.PushToWriterFirst, "Namespace construction should always be pushed to writer.");
// Runtime checks must be made in the following cases:
// 1. Xml state is not known at compile-time, or is illegal
// 2. Namespaces might be added to element after attributes have already been added
callChk = CheckEnumAttrs(info) || MightHaveNamespacesAfterAttributes(info);
// If WriteNamespaceDeclarationChk will *not* be called, then code must be generated to ensure well-formedness
// and track namespace scope.
if (!callChk)
BeforeStartChecks(ndNmsp);
this.helper.LoadQueryOutput();
// Recursively construct prefix and ns
NestedVisitEnsureStack(ndNmsp.Left);
NestedVisitEnsureStack(ndNmsp.Right);
// Generate call to WriteNamespaceDecl
this.helper.CallWriteNamespaceDecl(callChk);
if (!callChk)
AfterEndChecks(ndNmsp);
this.iterCurr.Storage = StorageDescriptor.None();
return ndNmsp;
}