使用PHP针对Schematron验证XML

时间:2011-01-27 22:53:59

标签: php xml schematron

有很多关于Schematron的资源......但是我无法找到任何相关的或关于如何针对Schematront .sch文件验证xml的示例。

任何?

我已经找到了1或2个非常老的类,它们会返回错误...所以如果有人知道怎么做,请帮忙。

1 个答案:

答案 0 :(得分:2)

我使用'ANT'选项..

在build.xml

<project name="myName" default="all" basedir=".">
  <taskdef name="schematron"
          classname="com.schematron.ant.SchematronTask"
          classpath="lib/ant-schematron-2010-04-14.jar;lib/saxon9he.jar"/>

  <target name="all" description="test it">
    <schematron schema="sch/test.sch" failonerror="false" debugMode="true">
      <fileset dir="./xml" includes="*.xml"/>
    </schematron>
  </target>

</project>

debugMode = true显示中间XSLT文件