Show All

# documentSchema Element

Defines an XML Schema for a form.

## Type

    xsd:complexType

## Structure

Name | Description
--- | ---
location | (Required attribute) Contains the namespace Uniform Resource Identifier (URI) and location (a Uniform Resource Locator (URL), relative to the form definition (.xsf) file), and delimited by a white space, of the .xsd file defining the XML Schema.
rootSchema | (Optional attribute) Identifies an XML Schema as the top-level schema of the form being filled out.

## Remarks

The documentSchema element is a required element of the documentSchemas element. One documentSchema element is present for each declared XML Schema in the form.

Microsoft Office InfoPath 2003 includes all XML Schemas in the form template and modifies the schema references in the .xsd files to be relative path names. If a form's underlying XML document contains references to multiple XML Schemas, they are listed with separate documentSchema elements and the top-level XML Schema has its rootSchema attribute set to "yes".

If an XML Schema file contains references to other XML Schema files using the include or import settings, those referenced files do not have to be listed in the documentSchemas element. However, they must be included in the form template with their references changed to relative file names.

## Example

The following is an example of the documentSchema element:

    <xsf:documentSchemas>
       <xsf:documentSchema
          location="urn:schema:custom:Namespace customFilename.xsd"
          rootSchema="yes"/>
    </xsf:documentSchemas>

©2003-2004 Microsoft Corporation. All rights reserved. Permission to copy, display and distribute this document is available at: http://msdn.microsoft.com/library/en-us/odcXMLRef/html/odcXMLRefLegalNotice.asp