Microsoft.Xml.SgmlReader
1.8.25
See the version list below for details.
dotnet add package Microsoft.Xml.SgmlReader --version 1.8.25
NuGet\Install-Package Microsoft.Xml.SgmlReader -Version 1.8.25
<PackageReference Include="Microsoft.Xml.SgmlReader" Version="1.8.25" />
<PackageVersion Include="Microsoft.Xml.SgmlReader" Version="1.8.25" />
<PackageReference Include="Microsoft.Xml.SgmlReader" />
paket add Microsoft.Xml.SgmlReader --version 1.8.25
#r "nuget: Microsoft.Xml.SgmlReader, 1.8.25"
#addin nuget:?package=Microsoft.Xml.SgmlReader&version=1.8.25
#tool nuget:?package=Microsoft.Xml.SgmlReader&version=1.8.25
SgmlReader - Convert (almost) any HTML to valid XML
SgmlReader is a versatile C# .NET library written by Chris Lovett for parsing SGML files using the XmlReader API including HTML and OFX data. A command line utility is also provided which outputs the well formed XML result.
MindTouch uses the SgmlReader library extensively. They have also made many improvements to it.
SgmlReaderDll API
The SgmlReader is an implementation of the XmlReader API. So the only thing you really need to know
is how to construct it. SgmlReader
has a default constructor, then you need to set some of the
properties. To load a DTD you must specify DocType="HTML"
or you must provide a SystemLiteral
. To
specify the SGML document you must provide either the InputStream
or Href
. Everything else is
optional. Then you can read from this reader like any other XmlReader
class.
Nuget Package
This code is packaged and published at https://www.nuget.org/packages/Microsoft.Xml.SgmlReader/ for your convenience. Using Visual Studio, Manage Nuget Packages simply search for the online package named "Microsoft.Xml.SgmlReader" add it to your project and you are good to go.
Sample Usage
// setup SgmlReader
Sgml.SgmlReader sgmlReader = new Sgml.SgmlReader()
{
DocType = "HTML",
WhitespaceHandling = WhitespaceHandling.All,
CaseFolding = Sgml.CaseFolding.ToLower,
InputStream = reader
};
// create document
XmlDocument doc = new XmlDocument()
{
PreserveWhitespace = true,
XmlResolver = null
};
doc.Load(sgmlReader);
return doc;
Release History
Release notes for 1.8.25
- Performance improvement parsing attributes with empty values.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 is compatible. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. |
.NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 is compatible. |
.NET Standard | netstandard2.0 is compatible. netstandard2.1 is compatible. |
.NET Framework | net45 is compatible. net451 was computed. net452 was computed. net46 is compatible. net461 was computed. net462 was computed. net463 was computed. net47 is compatible. net471 was computed. net472 was computed. net48 is compatible. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen40 was computed. tizen60 was computed. |
Universal Windows Platform | uap is compatible. uap10.0 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETCoreApp 3.1
- No dependencies.
-
.NETFramework 4.5
- No dependencies.
-
.NETFramework 4.6
- No dependencies.
-
.NETFramework 4.7
- No dependencies.
-
.NETFramework 4.8
- No dependencies.
-
.NETStandard 2.0
- No dependencies.
-
.NETStandard 2.1
- No dependencies.
-
net5.0
- No dependencies.
-
UAP 0.0
- No dependencies.
NuGet packages (6)
Showing the top 5 NuGet packages that depend on Microsoft.Xml.SgmlReader:
Package | Downloads |
---|---|
Devlooped.Web
Read HTML as XML and query it with CSS over XLinq: the most productive and lean library for web scraping using the latest and greatest that .NET can offer (HtmlAgilityPack killer). Provides HtmlDocument.Load and CssSelectElement(s) extension methods for XDocument/XElement. > This project uses SponsorLink and may issue IDE-only warnings if no active sponsorship is detected. > Learn more at https://github.com/devlooped#sponsorlink. |
|
jcoliz.OfxSharp.NetStandard
OFX file parser in a .NET Standard library |
|
Restless.OfxSharper
Provides Ofx parsing and building services |
|
SgmlSanitizer
A sanitizer to remove elements and attributes from SGML based text files, such as HTML and XML. Note that this is a very simple implementation, but by using whitelists and a naïve URL detection implementation XSS may be prevented. Use at your own risk though. |
|
Net4x.HtmlCleaner
Package Description |
GitHub repositories (4)
Showing the top 4 popular GitHub repositories that depend on Microsoft.Xml.SgmlReader:
Repository | Stars |
---|---|
dotnet/android
.NET for Android provides open-source bindings of the Android SDK for use with .NET managed languages such as C#
|
|
microsoft/XmlNotepad
XML Notepad provides a simple intuitive User Interface for browsing and editing XML documents.
|
|
wmjordan/Codist
A visual studio extension which enhances syntax highlighting, quick info (tooltip), navigation bar, scrollbar, display quality, and brings smart tool bar with code refactoring to code editor.
|
|
dotnet/java-interop
Java.Interop provides open-source bindings of Java's Java Native Interface (JNI) for use with .NET managed languages such as C#
|
Version | Downloads | Last updated |
---|---|---|
1.8.30 | 72,409 | 5/9/2023 |
1.8.29 | 909 | 4/14/2023 |
1.8.28 | 31,816 | 1/4/2023 |
1.8.27 | 426 | 1/4/2023 |
1.8.26 | 18,563 | 10/25/2022 |
1.8.25 | 117,742 | 9/29/2021 |
1.8.24 | 3,889 | 7/23/2021 |
1.8.23 | 566 | 7/21/2021 |
1.8.22 | 400 | 7/20/2021 |
1.8.21 | 24,651 | 3/18/2021 |
1.8.20 | 646 | 2/2/2021 |
1.8.19 | 1,042 | 1/29/2021 |
1.8.18 | 10,119 | 10/25/2020 |
1.8.17 | 14,816 | 7/24/2020 |
1.8.16 | 24,953 | 6/1/2020 |
1.8.15 | 628 | 6/1/2020 |
1.8.14 | 172,664 | 2/3/2017 |
1.8.13 | 1,973 | 9/11/2016 |
1.8.12 | 3,718 | 9/11/2016 |