Skip to content

Commit eb8a850

Browse files
committed
Use classes from latest AngleSharp
1 parent c1942c9 commit eb8a850

File tree

5 files changed

+7
-215
lines changed

5 files changed

+7
-215
lines changed

src/AngleSharp.Xml/Dom/Entity.cs

Lines changed: 0 additions & 144 deletions
This file was deleted.

src/AngleSharp.Xml/Dom/Notation.cs

Lines changed: 0 additions & 65 deletions
This file was deleted.

src/AngleSharp.Xml/Dtd/Parser/Tokens/DtdEntityToken.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
namespace AngleSharp.Xml.Dtd.Parser
22
{
3-
using AngleSharp.Xml.Dom;
3+
using AngleSharp.Dom;
44
using System;
55

66
sealed class DtdEntityToken : DtdToken
@@ -66,7 +66,7 @@ public String ExternNotation
6666

6767
public Entity ToElement()
6868
{
69-
return new Entity(Name)
69+
return new Entity(null, Name)
7070
{
7171
NotationName = null,
7272
NodeValue = Value

src/AngleSharp.Xml/Dtd/Parser/Tokens/DtdNotationToken.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
namespace AngleSharp.Xml.Dtd.Parser
22
{
3-
using AngleSharp.Xml.Dom;
3+
using AngleSharp.Dom;
44
using System;
55

66
sealed class DtdNotationToken : DtdToken
@@ -68,7 +68,7 @@ public String SystemIdentifier
6868

6969
public Notation ToElement()
7070
{
71-
return new Notation(Name)
71+
return new Notation(null, Name)
7272
{
7373
PublicId = PublicIdentifier,
7474
SystemId = SystemIdentifier

src/AngleSharp.Xml/XmlConfigurationExtensions.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ namespace AngleSharp.Xml
55
using AngleSharp.Svg.Dom;
66
using AngleSharp.Xml.Dom;
77
using AngleSharp.Xml.Parser;
8+
using System;
89
using System.Linq;
910
using System.Threading;
1011
using System.Threading.Tasks;
@@ -38,7 +39,7 @@ public static IConfiguration WithXml(this IConfiguration configuration)
3839

3940
private static Task<IDocument> LoadXmlAsync(IBrowsingContext context, CreateDocumentOptions options, CancellationToken cancellationToken)
4041
{
41-
var parser = context.GetService<IXmlParser>();
42+
var parser = context.GetService<IXmlParser>() ?? throw new InvalidOperationException("The IXmlParser service has been removed. Cannot continue.");
4243
var document = new XmlDocument(context, options.Source);
4344
document.Setup(options.Response, options.ContentType, options.ImportAncestor);
4445
context.NavigateTo(document);
@@ -47,7 +48,7 @@ private static Task<IDocument> LoadXmlAsync(IBrowsingContext context, CreateDocu
4748

4849
private static Task<IDocument> LoadSvgAsync(IBrowsingContext context, CreateDocumentOptions options, CancellationToken cancellationToken)
4950
{
50-
var parser = context.GetService<IXmlParser>();
51+
var parser = context.GetService<IXmlParser>() ?? throw new InvalidOperationException("The IXmlParser service has been removed. Cannot continue.");
5152
var document = new SvgDocument(context, options.Source);
5253
document.Setup(options.Response, options.ContentType, options.ImportAncestor);
5354
context.NavigateTo(document);

0 commit comments

Comments
 (0)