当前位置: 技术问答>java相关
有没有根据schema文件检验xml文档的java包或方法??
来源: 互联网 发布时间:2017-03-09
本文导语: 谢谢了 | XML Spy只是个XML编辑工具而已。 -------------------------------------------------------------------- Validating with XML Schema Now that you understand more about namespaces, you're ready to take a deeper look at the pr...
谢谢了
|
XML Spy只是个XML编辑工具而已。
--------------------------------------------------------------------
Validating with XML Schema
Now that you understand more about namespaces, you're ready to take a deeper look at the process of XML Schema validation. Although a full treatment of XML Schema is beyond the scope of this tutorial, this section will show you the steps you need to take to validate an XML document using an XML Schema definition. (You can also examine the sample programs that are part of the JAXP download. They use a simple XML Schema definition to validate personnel data stored in an XML file.)
--------------------------------------------------------------------------------
Note: There are multiple schema-definition languages, including RELAX NG, Schematron, and the W3C "XML Schema" standard. (Even a DTD qualifies as a "schema", although it is the only one that does not use XML syntax to describe schema constraints.) However, "XML Schema" presents us with a terminology challenge. While the phrase "XML Schema schema" would be precise, we'll use the phrase "XML Schema definition" to avoid the appearance of redundancy.
--------------------------------------------------------------------------------
At the end of this section, you'll also learn how to use an XML Schema definition to validate a document that contains elements from multiple namespaces.
--------------------------------------------------------------------
Validating with XML Schema
Now that you understand more about namespaces, you're ready to take a deeper look at the process of XML Schema validation. Although a full treatment of XML Schema is beyond the scope of this tutorial, this section will show you the steps you need to take to validate an XML document using an XML Schema definition. (You can also examine the sample programs that are part of the JAXP download. They use a simple XML Schema definition to validate personnel data stored in an XML file.)
--------------------------------------------------------------------------------
Note: There are multiple schema-definition languages, including RELAX NG, Schematron, and the W3C "XML Schema" standard. (Even a DTD qualifies as a "schema", although it is the only one that does not use XML syntax to describe schema constraints.) However, "XML Schema" presents us with a terminology challenge. While the phrase "XML Schema schema" would be precise, we'll use the phrase "XML Schema definition" to avoid the appearance of redundancy.
--------------------------------------------------------------------------------
At the end of this section, you'll also learn how to use an XML Schema definition to validate a document that contains elements from multiple namespaces.