You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何通过命令行使用Saxon执行Schema验证?解决「无样式表找到」错误

解决Saxon命令行Schema验证「无样式表找到」错误
  • 错误原因:当前命令未明确指定执行Schema验证操作,Saxon默认会尝试启动XSLT转换流程,因此找不到样式表时抛出该错误。
  • 修正方案:添加-validate:strict(或-validate)参数,明确触发Schema验证逻辑,修正后的命令如下:
java -Xmx2000m -jar C:\Saxon\saxon9ee.jar -s:C:\Documents\Test\finalOutput\F4.xml -xsd:"C:\Documents\Test\claw.xsd" -validate:strict

也可以用-xsdvalidate参数替代-validate:strict,效果一致:

java -Xmx2000m -jar C:\Saxon\saxon9ee.jar -s:C:\Documents\Test\finalOutput\F4.xml -xsd:"C:\Documents\Test\claw.xsd" -xsdvalidate

参数说明:

  • -validate:strict:启用严格模式的Schema验证,会报告所有违反Schema规则的错误
  • -xsd:指定要使用的Schema文件路径
  • -s:指定要验证的XML文件路径

内容的提问来源于stack exchange,提问作者David

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.23 07:09:11