{"record":{"id":"4ce4567be3f4235d","repo":"dotnet/wpf","slug":"cannot-nest-fixedpage-in-fixedpage","errorCode":null,"errorMessage":"Cannot nest FixedPage in FixedPage.","messagePattern":"Cannot nest FixedPage in FixedPage\\.","errorType":"exception","errorClass":"XmlException","httpStatus":null,"severity":"error","filePath":"src/Microsoft.DotNet.Wpf/src/PresentationFramework/MS/Internal/IO/Packaging/XamlFilter.cs","lineNumber":779,"sourceCode":"            uint lcid = GetCurrentLcid();\n            SkipCurrentElement();\n            return BuildIndexingContentUnit(textContent, lcid);\n        }\n\n        /// <summary>\n        /// Load FixedPage element into a DOM tree to initialize a FixedPageContentExtractor.\n        /// The content extractor will then be used to incrementally return the content of the fixed page.\n        /// </summary>\n        private IndexingContentUnit ProcessFixedPage()\n        {\n            // Reader is positioned on the start-tag for a FixedPage element.\n            Debug.Assert(string.Equals(_xamlReader.LocalName, _fixedPageName, StringComparison.Ordinal));\n\n            // A FixedPage nested in a FixedPage is invalid.\n            // XmlException gets handled inside this class (see GetChunk).\n            if (_filterState == FilterState.FindNextFlowUnit)\n            {\n                throw new XmlException(SR.XamlFilterNestedFixedPage);\n            }\n\n            // Create a DOM for the current FixedPage.\n            string fixedPageMarkup = _xamlReader.ReadOuterXml();\n            XmlDocument fixedPageTree = new XmlDocument();\n            fixedPageTree.LoadXml(fixedPageMarkup);\n\n            // Preserve the current language ID\n            if (_xamlReader.XmlLang.Length > 0)\n            {\n                fixedPageTree.DocumentElement.SetAttribute(_xmlLangAttribute, _xamlReader.XmlLang);\n            }\n\n            // Initialize a content extractor with this DOM tree.\n            _fixedPageContentExtractor = new FixedPageContentExtractor(fixedPageTree.DocumentElement);\n\n            // Save the DOM (to search for flow elements in it once the extractor is done)\n            // and switch to extractor mode.","sourceCodeStart":761,"sourceCodeEnd":797,"githubUrl":"https://github.com/dotnet/wpf/blob/81131a70a4c573cd62748a5c36908fc4d662daa9/src/Microsoft.DotNet.Wpf/src/PresentationFramework/MS/Internal/IO/Packaging/XamlFilter.cs#L761-L797","documentation":"ArgumentException from XamlFilter.ProcessFixedPage: a FixedPage element was encountered nested inside another FixedPage, which is not a legal fixed-document structure, so the incremental content extractor refuses to load the inner page.","triggerScenarios":"Thrown at src/Microsoft.DotNet.Wpf/src/PresentationFramework/MS/Internal/IO/Packaging/XamlFilter.cs:779 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Correct the document structure so FixedPage elements are not nested","Re-generate the XPS/fixed document from a valid source"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"81131a70a4c573cd62748a5c36908fc4d662daa9","analyzedAt":"2026-09-14T10:12:48.479Z","contentChangedAt":"2026-09-14T10:12:48.479Z","schemaVersion":2},"datasetVersion":"2026-09-21T21:30:21.729Z"}