Created
July 29, 2018 17:15
-
-
Save Nihlus/5145ff91b5f71913578c22f361dae710 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var functionDocumentations = new List<FunctionDocumentation>(); | |
var namespaceManager = new XmlNamespaceManager(new NameTable()); | |
namespaceManager.AddNamespace("mml", "http://www.w3.org/1998/Math/MathML"); | |
var parserContext = new XmlParserContext(null, namespaceManager, null, XmlSpace.None); | |
var schemas = new XmlSchemaSet(new NameTable()); | |
var xmlSettings = new XmlReaderSettings | |
{ | |
DtdProcessing = DtdProcessing.Ignore, | |
IgnoreComments = true, | |
IgnoreWhitespace = true, | |
}; | |
var documentationFiles = Directory.EnumerateFiles(path, "*.xml", SearchOption.AllDirectories); | |
foreach (var documentationFile in documentationFiles) | |
{ | |
using (var fs = File.OpenRead(documentationFile)) | |
{ | |
using (var xr = XmlReader.Create(fs, xmlSettings, parserContext)) | |
{ | |
var doc = XDocument.Load(xr); | |
functionDocumentations.AddRange(ReadFunctionDocumentation(doc)); | |
} | |
} | |
} | |
return new ProfileDocumentation(functionDocumentations); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment