[]
        
(Showing Draft Content)

GrapeCity.Documents.Word.XmlMapping.SetMapping

SetMapping Method

SetMapping(string, string, string, bool)

Set mapping between a content control and an XML node stored within a Custom XML Data part in the document.

Declaration
public string SetMapping(string xPath, string prefixMappings = null, string customXmlPartId = null, bool supportRichTextControl = false)
Public Function SetMapping(xPath As String, Optional prefixMappings As String = Nothing, Optional customXmlPartId As String = Nothing, Optional supportRichTextControl As Boolean = False) As String
Parameters
Type Name Description
string xPath

The XPath expression which shall be evaluated to find the custom XML node which is mapped to the content control.

string prefixMappings

The set of prefix mappings which shall be used to interpret the XPath expression when the XPath expression is evaluated against the custom XML data parts in the document.

string customXmlPartId

The CustomXmlPart identifier which shall be used to evaluate the given XPath expression.

bool supportRichTextControl

Whether the xml mapping supports a content control with RichText type.

Returns
Type Description
string

Inner xml of the mapped node stored within a XmlDocument in the document.

SetMapping(XmlNode, string, bool)

Set mapping between a content control and an XML node stored within a Custom XML Data part in the document.

Declaration
public string SetMapping(XmlNode node, string customXmlPartId = null, bool supportRichTextControl = false)
Public Function SetMapping(node As XmlNode, Optional customXmlPartId As String = Nothing, Optional supportRichTextControl As Boolean = False) As String
Parameters
Type Name Description
XmlNode node

The System.Xml.XmlNode which is mapped to the content control.

string customXmlPartId

The CustomXmlPart identifier which shall be used to evaluate the given XPath expression.

bool supportRichTextControl

Whether the xml mapping supports a content control with RichText type.

Returns
Type Description
string

Inner xml of the mapped node stored within a XmlDocument in the document.

SetMapping<T>(Expression<Func<T>>, bool)

Set mapping between a content control and an XML node stored within a Custom XML Data part in the document.

Declaration
public string SetMapping<T>(Expression<Func<T>> builtInDocumentProperty, bool supportRichTextControl = false)
Public Function SetMapping(Of T)(builtInDocumentProperty As Expression(Of Func(Of T)), Optional supportRichTextControl As Boolean = False) As String
Parameters
Type Name Description
Expression<Func<T>> builtInDocumentProperty

The expression of a property from the BuiltInPropertyCollection which is mapped to the content control. Use it like this: SetMapping(() => document.Settings.BuiltInProperties.Author);

bool supportRichTextControl

Whether the xml mapping supports a content control with RichText type.

Returns
Type Description
string

Inner xml of the mapped node stored within a XmlDocument in the document.

Type Parameters
Name Description
T