Skip to content

Instantly share code, notes, and snippets.

@Nihlus
Created July 29, 2018 17:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Nihlus/5145ff91b5f71913578c22f361dae710 to your computer and use it in GitHub Desktop.
Save Nihlus/5145ff91b5f71913578c22f361dae710 to your computer and use it in GitHub Desktop.
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