使用PHP针对Schematron验证XML [英] Validate an XML against a Schematron using PHP

查看:103
本文介绍了使用PHP针对Schematron验证XML的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

关于Schematron的资源很多...但是我找不到任何相关的信息或关于如何根据Schematront .sch文件验证xml的示例.

There are a lot of resources about Schematron... however I cant find anything related or an example on how to validate an xml against a Schematront .sch file.

有人吗?

我已经发现1或2个非常老的类会返回错误...因此,如果有人知道该怎么做,请帮忙.

I already found 1 or 2 very old classes that return errors... so if anyone knows how to do this, please help.

推荐答案

我使用'ANT'选项.

I use the 'ANT' option..

Build.xml

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文件

debugMode=true shows you the intermediate XSLT file

这篇关于使用PHP针对Schematron验证XML的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆