MappingGroup Element
Applies to: SharePoint Server 2010
<MappingGroup base-path='basePath' attr='propName' propset='GUID' type='varType' sep-str='separator' pre-str='preString' post-str='postString' rec-sep-str='recSeparator' rec-pre-str='recPreString' rec-post-str='recPostString' select='merge|first|longest' mode='append|prepend|overwrite'></MappingGroup>
Attributes and Elements
The following sections describe attributes, child elements, and parent elements.
Attributes
Attribute |
Description |
---|---|
base-path |
Required. Specifies an XPath base path that the Mapping elements within this group will be relative to. |
attr |
Required. Specifies the property name of the created crawled property. |
propset |
Optional. Specifies a string that represents a hexadecimal property set GUID. Overrides the default property set. Applies only when the element is not part of a MappingGroup element. |
type |
Optional. Specifies a variant type that overrides the default variant type. Applies only when the element is not part of a MappingGroup element. |
sep-str |
Optional. Specifies the separation string when the base-path matches more than one XML node. Default: A single space character. |
pre-str |
Optional. Specifies a string to prepend to the extracted content. Default: An empty string. |
post-str |
Optional. Specifies a string to append to the extracted content. Default: An empty string. |
rec-sep-str |
Optional. Specifies the string separator to use between contents from each Mapping element in the group. Default: A single space character. |
rec-pre-str |
Optional. Specifies a string to prepend to the first Mapping element in the group. |
rec-post-str |
Optional. Specifies a string to append to the last Mapping element in the group. |
select |
Optional. Defines which Mapping elements to retrieve content from. Default: merge |
mode |
Optional. Defines the behavior when another Mapping element or MappingGroup element has mapped content to the same property name. Default: append |
select Attribute
Value |
Description |
---|---|
merge |
Merges the content from all elements by using the rec-sep-str, rec-pre-str, and rec-post-str attributes. |
first |
Gets content from the first element that has content. |
longest |
Gets content from the element that has the longest content. |
mode Attribute
Value |
Description |
---|---|
append |
Adds the new content to the end of the existing content. |
prepend |
Adds the new content to the beginning of the existing content. |
overwrite |
Overwrites the existing content. |
Child Elements
Element |
Description |
---|---|
Maps an XPath expression to a crawled property. |
Parent Elements
Element |
Description |
---|---|
Specifies a set of mappings from XPath expressions to crawled properties. |
Example
The first code section provides sample XML input. The second code section provides an associated XML Mapper configuration that provides two Mapping expressions inside a MappingGroup.
<Document>
<Tags>
<Keywords>funny</Keywords>
<UserTags>hilarious</UserTags>
</Tags>
</Document>
<XMLMappings>
<MappingGroup attr="mytags" base-path="//Tags" rec-sep-str=",">
<Mapping path="Keywords"/>
<Mapping path="UserTags"/>
</MappingGroup>
</XMLMappings>
This example will produce a crawled property that has the value funny,hilarious.