首页 > 解决方案 > 错误:模板的内容不遵循架构

问题描述

我有一个定义如下的 SVG 文档

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<svg width="210mm" height="297mm"  xmlns="http://www.w3.org/2000/svg" dominant-baseline="hanging">
<text x="108.18mm" y="7.14mm" font-size="12pt" font-family="Times New Roman" font-weight="bold" font-style="italic">SVG Template to Test Various Styling</text>
<style>
    text {
      fill: gold;
      stroke: maroon;
      stroke-width: 2px;
    }
 </style>
</svg>

虽然当我将它传递给 C# 应用程序时,这个 SVG 按预期在浏览器中被预览,该应用程序被构建为在抛出异常时读取 svgs **`

模板的内容不遵循架构

`** 。

我不知道是什么原因造成的,因为浏览器似乎正在按预期呈现

此外,错误还说:-命名空间'http://www.w3.org/2000/svg'中的元素'svg'在命名空间' http://www.w3.org/2000有无效的子元素'style' /svg '

有什么想法可以帮助我吗?

标签: c#.netsvgschema

解决方案


推荐阅读