Files
tldr/pages.zh/common/xml-validate.md

24 lines
768 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# XML 验证
> 验证 XML 文档。
> 更多信息:<https://xmlstar.sourceforge.net/docs.php>。
- 仅验证一个或多个 XML 文档的格式正确性:
`xml validate {{path/to/input1.xml|URI}} {{input2.xml ...}}`
- 验证一个或多个 XML 文档是否符合文档类型定义 (DTD)
`xml validate --dtd {{path/to/schema.dtd}} {{path/to/input1.xml|URI}} {{input2.xml ...}}`
- 验证一个或多个 XML 文档是否符合 XML 架构定义 (XSD)
`xml validate --xsd {{path/to/schema.xsd}} {{path/to/input1.xml|URI}} {{input2.xml ...}}`
- 验证一个或多个 XML 文档是否符合 Relax NG 架构 (RNG)
`xml validate --relaxng {{path/to/schema.rng}} {{path/to/input1.xml|URI}} {{input2.xml ...}}`
- 显示帮助信息:
`xml validate --help`