April 2006
Intermediate to advanced
456 pages
15h 32m
English
XML data is structured. We can define what a complete purchase order looks like and then compare the documents we receive to that document. This is known as validation. One way to specify a document's structure is with the XML Schema Definition (XSD) language. XSD is an XML vocabulary used to articulate rules for business data. Example 14-1 shows the XML schema used in a web service that retrieves an address.
Example 14-1. An XML schema
<xsd:schema targetNamespace="http://sap.com/demo/WS/GetAddress/prepared" xmlns="http://sap.com/demo/WS/GetAddress/prepared" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <xsd:element name="Request_Message" type="Request"/> <xsd:element name="Response_Message" type="Response"/> <xsd:complexType name="Request"> <xsd:sequence> <xsd:element name="Employee_Id" type="xsd:string"/> <xsd:element name="Address_Type" type="xsd:string"/> <xsd:element name="Date" type="xsd:string"/> </xsd:sequence> </xsd:complexType> <xsd:complexType name="Response"> <xsd:sequence> <xsd:element name="First_Name" type="xsd:string"/> <xsd:element name="Last_Name" type="xsd:string"/> <xsd:element name="Care_of_Name" type="xsd:string"/> <xsd:element name="Street_Name" type="xsd:string"/> <xsd:element name="House_Number" type="xsd:string"/> <xsd:element name="Name_of_City" type="xsd:string"/> <xsd:element name="Zipcode" type="xsd:string"/> <xsd:element name="County" type="xsd:string"/> <xsd:element name="Country" type="xsd:string"/> <xsd:element name="Email_Address" ...
Read now
Unlock full access