When you have a simple, non-changing schema, as in this example, you can create the schema once and vend it to the M-Business XML conduit from a static file. When you are creating a more complex application, you might generate the XSD file dynamically from the back-end data source. The sample code below shows the XSD file for this application. The table below that lists the data types that are supported in XSD files.
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:dt="urn:schemas-microsoft-com:datatypes"
xmlns:msch="urn:schemas-microsoft-com:mapping-schema">
<xsd:element name="Employees" msch:relation="Employees"
type="Employees_type" />
<xsd:complexType name="Employees_type">
<xsd:attribute name="id" type="xsd:int" />
<xsd:attribute name="lastname" type="xsd:string" />
<xsd:attribute name="firstname" type="xsd:string" />
<xsd:attribute name="phonenumber" type="xsd:string" />
<xsd:key name="PrimaryKey">
<xsd:selector xpath="." />
<xsd:field xpath="@id" />
</xsd:key>
</xsd:complexType>
</xsd:schema> |
You can find the sample code shown in the figure above in the employees.xsd file, which is available in DB_sample.zip file on the M-Business Anywhere Product Manuals page, referenced in Related publications.
Table 1. Supported data types in XSD files
|
Data type |
XSD type specification |
||
|---|---|---|---|
|
64-bit unsigned integer |
|
||
|
32-bit signed integer |
|
||
|
32-bit unsigned integer |
|
||
|
16-bit signed integer |
|
||
|
16-bit unsigned integer |
|
||
|
character string (32kB maximum size) |
|
||
|
boolean value (valid values: |
|
||
|
date/time value (supports dates from January 1, 1902, to January 1, 2038—format is: |
|
| Send feedback about this page using email. | Copyright © 2008, iAnywhere Solutions, Inc. |