Viewing the Underlying XML Schema


An important part of customizing the sample forms is understanding the underlying XML schema and the fields it contains. Understanding what data fields are being collected from the form will help you map this form to your existing processes, applications, and database systems. The process of mapping these data structures to an existing data source is called “semantic mapping” and will help you identify where you need to modify existing processes or import routines to fit your own use.

To see the underlying XML schema that is in use behind a form, open the form in design mode and then select File > Extract Form Files. Another dialog will open and prompt you where to save your form files—you can select a location on your computer or you can use the New Folder button at the bottom of the dialog to create a new folder to hold your form files. When you have selected a location for your files, click OK to extract the form files to the location you specified.

Next, browse to the location where you extracted the form files—you should see all of the different files that make up an .XSN form, including .XML, .XSL .JS and other file types. Locate the schema file (.XSD) and open this file using Notepad or the text editor of your choice. This schema file contains information about the underlying data source for your form and can be used to match the fields in the form to fields in an existing application or database you may use.

If you are just getting started setting up applications and systems, you can use this schema as a template for a new table or database to hold the form data. An example of an XML schema for the sample Absence Request form is shown next for your reference:

<?xml version="1.0" encoding="UTF-8"?> <xs:schema  targetNamespace="http://schemas.microsoft.com/office/infopath/2003/sample/AbsenceRequest"  xmlns:ar="http://schemas.microsoft.com/office/infopath/2003/sample/AbsenceRequest"  xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"  attributeFormDefault="unqualified">

<xs:element name="absenceRequest">
<xs:complexType>
<xs:sequence>
<xs:element name="date" type="xs:date" nillable="true"/>
<xs:element name="time" type="xs:time" nillable="true"/>
<xs:element name="purpose" type="xs:string"/>
<xs:element name="contact" type="ar:contactType"/>
<xs:element name="manager" type="ar:contactType"/>
<xs:element name="awayContact" minOccurs="0">
<xs:complexType>
<xs:sequence>
<xs:element name="business" type="ar:contactType"/>
<xs:element name="personal" type="ar:contactType"/>
<xs:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="leaves">
<xs:complexType>
<xs:sequence>
<xs:element name="leave" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element name="startDate" type="xs:date" nillable="true"/>
<xs:element name="returnDate" type="xs:date" nillable="true"/>
<xs:element name="hours" type="xs:double"/>
<xs:element name="leaveCode" type="xs:string"/>
<xs:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="totalLeaveThisRequest" type="xs:double"/>
<xs:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="balances" minOccurs="0">
<xs:complexType>
<xs:sequence>
<xs:element name="paidVacation" type="ar:balanceType"/>
<xs:element name="sickLeave" type="ar:balanceType"/>
<xs:element name="floatingHoliday" type="ar:balanceType"/>
<xs:element name="unpaidLeave" type="ar:balanceType"/>
<xs:element name="bereavement" type="ar:balanceType"/>
<xs:element name="other" type="ar:balanceType"/>
<xs:element name="newLeaveBalance" type="xs:double"/>
<xs:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="notes" type="ar:xhtml" minOccurs="0"/>
<xs:element name="items">
<xs:complexType>
<xs:sequence>
<xs:element name="item" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element name="date" type="xs:date" nillable="true"/>
<xs:element name="description" type="xs:string"/>
<xs:element name="amount" type="xs:double"/>
<xs:element name="category" type="xs:string"/>
<xs:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="list">
<xs:complexType>
<xs:sequence>
<xs:element name="listItem" type="xs:string" maxOccurs="unbounded"/>
<xs:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="signatures" type="ar:digitalSignaturesType"/>
<xs:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
<xs:anyAttribute namespace="http://www.w3.org/XML/1998/namespace" processContents="lax"/>
</xs:complexType>
</xs:element>
<xs:complexType name="balanceType">
<xs:sequence>
<xs:element name="previousBalance" type="xs:double"/>
<xs:element name="totalThisRequest" type="xs:double"/>
<xs:element name="newBalance" type="xs:double"/>
<xs:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="addressType">
<xs:sequence>
<xs:element name="line1" type="xs:string"/>
<xs:element name="line2" type="xs:string"/>
<xs:element name="line3" type="xs:string"/>
<xs:element name="line4" type="xs:string"/>
<xs:element name="city" type="xs:string"/>
<xs:element name="stateProvince" type="xs:string"/>
<xs:element name="postalCode" type="xs:string"/>
<xs:element name="country" type="xs:string"/>
<xs:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="companyType">
<xs:sequence>
<xs:element name="name" type="xs:string" minOccurs="0"/>
<xs:element name="address" type="ar:addressType" minOccurs="0"/>
<xs:element name="identificationNumber" type="xs:string" minOccurs="0"/>
<xs:element name="telephoneNumber" type="xs:string" minOccurs="0"/>
<xs:element name="faxNumber" type="xs:string" minOccurs="0"/>
<xs:element name="emailAddressPrimary" type="xs:string" minOccurs="0"/>
<xs:element name="webSite" type="xs:anyURI" minOccurs="0"/>
<xs:element name="ftpSite" type="xs:anyURI" minOccurs="0"/>
<xs:element name="telex" type="xs:string" minOccurs="0"/>
<xs:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="companyWithContactType">
<xs:complexContent>
<xs:extension base="ar:companyType">
<xs:sequence>
<xs:element name="contact" type="ar:contactType"/>
<xs:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:complexType name="contactType">
<xs:sequence>
<xs:element name="name" type="ar:nameType" minOccurs="0"/>
<xs:element name="address" type="ar:addressType" minOccurs="0"/>
<xs:element name="identificationNumber" type="xs:string" minOccurs="0"/>
<xs:element name="emailAddressPrimary" type="xs:string" minOccurs="0"/>
<xs:element name="emailAddressSecondary" type="xs:string" minOccurs="0"/>
<xs:element name="telephoneNumberWork" type="xs:string" minOccurs="0"/>
<xs:element name="telephoneNumberHome" type="xs:string" minOccurs="0"/>
<xs:element name="telephoneNumberCell" type="xs:string" minOccurs="0"/>
<xs:element name="telephoneNumberPager" type="xs:string" minOccurs="0"/>
<xs:element name="faxNumber" type="xs:string" minOccurs="0"/>
<xs:element name="jobTitle" type="xs:string" minOccurs="0"/>
<xs:element name="officeLocation" type="xs:string" minOccurs="0"/>
<xs:element name="department" type="xs:string" minOccurs="0"/>
<xs:element name="webSite" type="xs:anyURI" minOccurs="0"/>
<xs:element name="ftpSite" type="xs:anyURI" minOccurs="0"/>
<xs:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="contactWithCompanyType">
<xs:complexContent>
<xs:extension base="ar:contactType">
<xs:sequence>
<xs:element name="company" type="ar:companyType"/>
<xs:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:complexType name="digitalSignaturesType">
<xs:sequence>
<xs:any namespace="http://www.w3.org/2000/09/xmldsig#" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="nameType">
<xs:sequence>
<xs:element name="prefix" type="xs:string" minOccurs="0"/>
<xs:element name="givenName" type="xs:string" minOccurs="0"/>
<xs:element name="middleName" type="xs:string" minOccurs="0"/>
<xs:element name="surname" type="xs:string" minOccurs="0"/>
<xs:element name="suffix" type="xs:string" minOccurs="0"/>
<xs:element name="singleName" type="xs:string"/>
<xs:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="currencyType">
<xs:sequence>
<xs:element name="name" type="xs:string"/>
<xs:element name="symbol" type="xs:string"/>
<xs:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="xhtml" mixed="true">
<xs:sequence>
<xs:any namespace="http://www.w3.org/1999/xhtml" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
</xs:schema>




How to Do Everything with Microsoft Office InfoPath 2003
How to Do Everything with Microsoft Office InfoPath 2003 (How to Do Everything)
ISBN: 0072231270
EAN: 2147483647
Year: 2006
Pages: 142

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net