Hitachi

uCosminexus Application Server XML Processor User Guide


5.6.1 Processing Performed by the Sample Program

The sample program validates a purchase order created as an XML document. Because the purchase order uses the shared customer personal data, the schema document of the purchase order reads the schema document of the personal data. Note that the schema documents are identified in the Java program.

The following figure shows the flow of processing of the sample program that uses the XML Schema.

Figure 5‒4: Flow of processing of the sample program that uses the XML schema

[Figure]

The sample program performs the following processing:

  1. The program reads the schema document purchaseOrder.xsd.

    PurchaseOrder.xsd is the schema document that defines the product purchase order.

  2. PurchaseOrder.xsd reads the schema document personalData.xsd.

    PersonalData.xsd is the schema document for defining the personal data of the customers who place an order and has a different namespace than purchaseOrder.xsd.

  3. The program reads the XML document purchaseOrder.xml (or purchaseOrder-fail.xml).

    PurchaseOrder.xml or purchaseOrder-fail.xml is the XML document for the purchase order to be validated.

  4. The program validates the XML document.

    If the XML document is valid against the schema document, the standard output displays Validation OK. If not valid, the standard output displays Validation NG with a message.