Udostępnij za pośrednictwem


XML Document Property Parsing in SharePoint (5 of 5): Specifying XPath Namespace Prefixes in Content Types

This is the final post in a five-part series on how to use the built-in XML parser in WSS V3 to promote and demote document properties in your XML files, including InfoPath 2007 forms.

Read part one here.

Read part two here.

Read part three here.

Read part four here.

You can include namespace prefixes in the XPath expressions you use to specify the location of a document property. To use a namespace prefix, you must first define it in a custom XMLDocument element included in the content type definition.

The namespace for this XML node is:

https://schemas.microsoft.com/sharepoint/v3/contenttype/xmlform

The structure of the custom XMLDocument node is as follows:

<XmlDocument xmlns=

    "https://schemas.microsoft.com/sharepoint/v3/contenttype/xmlform">

<Namespaces>

  xmlns:prefix='value'

</Namespaces>

</XmlDocument>

Following is a list of the elements in the schema, and their definitions:

Namespaces The root element. Represents a collection of namespaces for use in XPath expressions.

For each namespace you specify, you must include the following values:

· prefix The prefix to use when designating this namespace.

· value The actual namespace for which you are specifying a prefix.

For example:

<XmlDocument xmlns=

    "https://schemas.microsoft.com/sharepoint/v3/contenttype/xmlform">

<Namespaces>

  xmlns:awUser='https://schemas.adventureworks.com/forms/2006/xslt/User'

</Namespaces>

</XmlDocument>

This schema describes optional XML you can include in a content type as custom information. For more information on including custom information in a content type, see this topic in the WSS V3 Beta 2 SDK.