C# 如何在.Net中进行ISO Schematron验证
我有一个NMatrix.schematron.dll,用于使用schematron(1.5)验证xml文件。我使用Linqpad进行测试。但我发现,如果使用ISO schematron标准,它就不起作用。 这是我的密码 这是schematron 1.5版:C# 如何在.Net中进行ISO Schematron验证,c#,xml,schematron,C#,Xml,Schematron,我有一个NMatrix.schematron.dll,用于使用schematron(1.5)验证xml文件。我使用Linqpad进行测试。但我发现,如果使用ISO schematron标准,它就不起作用。 这是我的密码 这是schematron 1.5版: <?xml version="1.0" encoding="UTF-8"?> <schema xmlns="http://www.ascc.net/xml/schematron"> <pattern name
<?xml version="1.0" encoding="UTF-8"?>
<schema xmlns="http://www.ascc.net/xml/schematron">
<pattern name="CheckUnique">
<rule context="*">
<assert test="1=1">
OK
</assert>
</rule>
</pattern>
</schema>
好啊
这是schematron iso版:
<?xml version="1.0" encoding="UTF-8"?>
<schema xmlns="http://purl.oclc.org/dsdl/schematron" queryBinding="xslt2"
xmlns:sqf="http://www.schematron-quickfix.com/validator/process">
<pattern id="CheckUnique">
<rule context="*">
<assert test="1=1">
OK
</assert>
</rule>
</pattern>
</schema>
好啊
唯一不同的是名称空间。当我将1.5版更改为ISO版时,验证不起作用。
为什么?
因为NMatrix.Schematron.dll?
谢谢。黄。好的。看起来你的根本问题是14年前的代码。在中,我们可以看到Schematron的名称空间硬编码为ISO之前的名称空间URI。您正在使用的代码不是设计用于ISO Schematron的
如果您不能采用“自己滚动”的方法并直接使用,那么您可能应该看看哪些声明支持ISO Schematron(我没有尝试过)为什么要使用这个令人讨厌的标题?呃,“没有工作”-怎么做?这意味着在我更改xmlns后没有“OK”出现
<?xml version="1.0" encoding="UTF-8"?>
<schema xmlns="http://purl.oclc.org/dsdl/schematron" queryBinding="xslt2"
xmlns:sqf="http://www.schematron-quickfix.com/validator/process">
<pattern id="CheckUnique">
<rule context="*">
<assert test="1=1">
OK
</assert>
</rule>
</pattern>
</schema>