{"record":{"id":"ef69e354ec76b7e4","repo":"microsoft/ailab","slug":"the-only-supported-xmlschema-is-0","errorCode":null,"errorMessage":"The only supported xmlSchema is {0}","messagePattern":"The only supported xmlSchema is (.+?)","errorType":"exception","errorClass":"NotSupportedException","httpStatus":null,"severity":"error","filePath":"Snip-Insights/SnipInsight/SendTo/OneNoteManager.cs","lineNumber":402,"sourceCode":"    internal class OneNoteXmlDoc\n    {\n        const OneNote.XMLSchema _oneNoteXmlSchema = OneNote.XMLSchema.xs2013;\n        XmlDocument _xmlDoc;\n        XmlNamespaceManager _namespaceMgr;\n        static readonly string NamespaceUri = \"http://schemas.microsoft.com/office/onenote/2013/onenote\";\n        static readonly string NamespacePrefix = \"one\";\n        static readonly string SectionNodeName = string.Format(\"{0}:Section\", NamespacePrefix);\n        static readonly string PageNodeName = string.Format(\"{0}:Page\", NamespacePrefix);\n        static readonly string OutlineNodeName = string.Format(\"{0}:Outline\", NamespacePrefix);\n        static readonly string SectionNodeXPath = string.Format(\"//{0}\", SectionNodeName);\n        static readonly string PageNodeXPath = string.Format(\"//{0}\", PageNodeName);\n        static readonly string OutlineNodeXPath = string.Format(\"//{0}/{1}\", PageNodeName, OutlineNodeName);\n\n        internal OneNoteXmlDoc(OneNote.XMLSchema xmlSchema)\n        {\n            if (xmlSchema != _oneNoteXmlSchema)\n            {\n                throw new NotSupportedException(string.Format(\"The only supported xmlSchema is {0}\", _oneNoteXmlSchema));\n            }\n\n            _xmlDoc = new XmlDocument();\n\n            _namespaceMgr = new XmlNamespaceManager(_xmlDoc.NameTable);\n            _namespaceMgr.AddNamespace(NamespacePrefix, NamespaceUri);\n        }\n\n         internal OneNoteEntity GetEntity(string hierarchyXml)\n        {\n            _xmlDoc.LoadXml(hierarchyXml);\n\n            XmlElement rootNode = _xmlDoc.DocumentElement;\n\n            OneNoteEntity entity = GetEntity(rootNode);\n\n            if (string.Compare(rootNode.Name, SectionNodeName, true) == 0)\n            {","sourceCodeStart":384,"sourceCodeEnd":420,"githubUrl":"https://github.com/microsoft/ailab/blob/89fe2fc62081145ec5408d42059cbcb7c4a033c8/Snip-Insights/SnipInsight/SendTo/OneNoteManager.cs#L384-L420","documentation":"OneNoteXmlDoc is built exclusively for the OneNote 2013 XML schema (xs2013, namespace http://schemas.microsoft.com/office/onenote/2013/onenote, fixed at compile time); this generic validation guard throws when code attempts to use the document with any other schema value. The invalid input is the schema argument/derived XML that is not xs2013 — e.g. hierarchy or page XML obtained from an older OneNote interop schema.","triggerScenarios":"Thrown at Snip-Insights/SnipInsight/SendTo/OneNoteManager.cs:402 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Ensure the OneNote interop/window is created with XMLSchema.xs2013 before requesting XML from OneNote","Convert or re-fetch hierarchy/page XML using the 2013 schema if a legacy schema version was used","Do not pass a schema parameter that differs from the class-level _oneNoteXmlSchema constant"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"89fe2fc62081145ec5408d42059cbcb7c4a033c8","analyzedAt":"2026-09-13T20:10:53.835Z","contentChangedAt":"2026-09-13T20:10:53.835Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}