This commit is contained in:
2025-05-15 00:48:26 +08:00
parent e13dcbb553
commit b689c013d7
8 changed files with 244 additions and 2 deletions

View File

@@ -0,0 +1,15 @@
namespace Yes.Infrastructure.Rss
{
public static class XDocumentExtensions
{
public static string ToStringWithDeclaration(this XDocument doc)
{
if (doc.Declaration == null)
return doc.ToString();
using var writer = new StringWriter();
doc.Save(writer);
return writer.ToString();
}
}
}