在我的web应用程序中,我使用xsd文件作为嵌入式资源来验证xml文档,使用assembly.GetManifestResourceStream(string)
很容易。如何在嵌入式xsd中使用include引用另一个嵌入式xsd?
我现在需要使用include
元素(其实我需要redefine
,但我得到的错误是一样的,所以我扩大问题的范围)内我的xsd的一个引用另一个嵌入的XSD,还等什么我所做的是:
以下行添加到项目的AssemblyInfo.cs中
[assembly: System.Web.UI.WebResource("TurniArc.xml.schema.ImportOperatoriParametri.xsd", "text/xml", PerformSubstitution = true)]
[assembly: System.Web.UI.WebResource("TurniArc.xml.schema.ProcessiInput.xsd", "text/xml", PerformSubstitution = true)]
修饰的“ImportOperatoriParametri.xsd”内的“包含”的元素插入此:
<xs:include schemaLocation="<% = WebResource("TurniArc.xml.schema.ProcessiInput.xsd") %>">
这种技术工作时,我不得不从嵌入式CSS参考的嵌入图像。可悲的是,这里没有,因为GetManifestResourceStream方法抛出异常
'<', hexadecimal value 0x3C, is an invalid attribute character. Line 3, position 34.
这似乎是“PerformSubstition”属性还没有设置,因为它试图读取的schemaLocation的属性为“正规”的字符串。
我在做什么错?谢谢
+1非常有用,也是重要的问题。 – 2011-03-07 00:03:55