How to validate an XML document using a RELAX NG schema and JAXP?

前端 未结 5 1073
时光说笑
时光说笑 2020-12-30 04:18

I would like to validate XML documents using RELAX NG schemata, and I would like to use the JAXP validation API.

From Googling around, it appeared that I could use J

5条回答
  •  梦毁少年i
    2020-12-30 04:30

    Another option is Trang, which is a RelaxNG-to-XMLSchema translator. I believe it's designed to be used as a build tool rather than a runtime library, but your best option might be to convert your schema to XMLSchema using Trang at build time, and then validate against that instead. That way, you can see exactly what the translation looks like, whilst getting full advantage of the XML Schema support of JAXP.

提交回复
热议问题