XML document instance verification

xiaoxiao2021-03-06  61

In enterprise XML applications, verifying an XML document is the key to ensuring proper operation. Even in a lot of applications, XML document verification is both part of the application.

Verify using DTD and XML Schema is our many people know. But this type is based on an outline, and the defined verification cannot be touched when the verification of many XML documents from the actual business. such as:

To verify the following logic: If a product takes the size property, you must have a Unit property at the same time, otherwise you will not know that it is "centimeter" or "inch" to mark the product. Such verification If you use DTD or XML Schema verification, it is very difficult. But if you use an XML instance description language (some local translation is based on rule language, XML mode language) is done better. Relax NG and Schematron are a good choice. Such languages ​​are used for XML verification, they can detach from DTD and XML Schema, and logic judges directly by parsing the XML document instance (ie: XML Instance).

Take schematron as an example, completely XPath based on XPath. Use XSL's Match mode to verify the XML instance document. After rapid start, I found that Schematron was used to write some business logic restriction rules in the enterprise XML application and very good choice, that is, powerful and simple.

Above: Schemtron's sign, a small fox? Activity related resources and links in a cartoon: Relax NG:

Relax NG Homepage Using Relax Ng Counterattack Schematron:

SCHEMATRON Home An Interview with Rick Jelliffe Validating XML with Schematron-End-

转载请注明原文地址:https://www.9cbs.com/read-114256.html

New Post(0)