用schematron验证xml错误

Mise_V 2017-07-21 01:50:51
同样的xml使用其他验证方式都行 用schematron就出现下面的错误 (都是书本的资源 没错误 )

false Invalid schematron : Failed to compile stylesheet. 1 error detected.

以下为xml 和 sch代码
<?xml version="1.0" encoding="UTF-8"?>
<?schematron path="Library-1.sch"?>
<library>
<book id="ACMAS-20" publishedDate="1920" genre="Detective Fiction">

</book>
<book id="EGOSC-77" publishedDate="1977" genre="Science Fiction">

</book>
</library>


<?xml version="1.0" encoding="UTF-8"?>
<schema xmlns="http://www.ascc.net/xml/schematron">
<pattern name="book attributes">
<rule context="book">
<assert test="@id">The 'book' element must have an 'id' attribute.</assert>
<assert test="@publishedDate">The 'book' element must have a 'publishedDate'
attribute.</assert>
<assert test="@genre">The 'book' element must have a 'genre' attribute.</assert>
</rule>
</pattern>
</schema>
...全文
299 回复 打赏 收藏 转发到动态 举报
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复

8,906

社区成员

发帖
与我相关
我的任务
社区描述
XML/XSL相关问题讨论专区
社区管理员
  • XML/XSL社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧