| name| city | state | zip | ||
| parent::*/street | An address should have a street. | |
| parent::*/city | An address should have a city. | |
| parent::*/state | An address should have a state. | |
| parent::*/zip | An address should have a zip. | |
| parent::*/@type | An address should have a type attribute. | |
| /name | /city | /state | /zip | ||
| self::* | The elements <name path=""/> is not expected at the top of a document. They form part of an address. | |
| shipTo | shipDate | Items | ||
| parent::*/shipTo | A purchase order should have a shipTo element. | |
| parent::*/shipDate | A purchase order should have a shipDate element. | |
| parent::*/Items | A purchase order should have an Items element. | |
| parent::*/@orderDate | A purchase order should have an orderDate attribute. | |
| /shipTo | /shipDate | /Items | ||
| self::* | The element <name path=""/> is not expected at the top of a document. It should be in the body of a purchase order. | |
| PurchaseOrder | ||
| shipTo | A purchase order element should have a shipping address. There should be a shipTo element contained by the PurchaseOrder element. | |
| shipTo | ||
| name | A shipping address element should have a name element. | |
| Items | ||
| count(child::*) = count(child::Item) | The Items element can only contain Item elements | |
| Item | ||
| productName | The Item element should contain a product name. | |
| quantity | The Item element should contain a quantity element | |
| price | The Item element should contain a price element. | |
| comment | ||
| child::* | A comment should have no subelements | |
| parent::Item | parent::PurchaseOrder | A comment can only appear in an Item or a Purchase Order | |
Schematron Pretty by Rick Jelliffe. The Schematron by Rick Jelliffe, Academia Sinica Computing Centre.