XslTransformation
Contents
[
Hide
]FieldIncludeText.XslTransformation property
Gets or sets the location of XSL Transformation to format XML data.
public string XslTransformation { get; set; }
Examples
Shows how to create an INCLUDETEXT field, and set its properties.
public void FieldIncludeText()
{
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
// Below are two ways to use INCLUDETEXT fields to display the contents of an XML file in the local file system.
// 1 - Perform an XSL transformation on an XML document:
FieldIncludeText fieldIncludeText = CreateFieldIncludeText(builder, MyDir + "CD collection data.xml", false, "text/xml", "XML", "ISO-8859-1");
fieldIncludeText.XslTransformation = MyDir + "CD collection XSL transformation.xsl";
builder.Writeln();
// 2 - Use an XPath to take specific elements from an XML document:
fieldIncludeText = CreateFieldIncludeText(builder, MyDir + "CD collection data.xml", false, "text/xml", "XML", "ISO-8859-1");
fieldIncludeText.NamespaceMappings = "xmlns:n='myNamespace'";
fieldIncludeText.XPath = "/catalog/cd/title";
doc.UpdateFields();
doc.Save(ArtifactsDir + "Field.INCLUDETEXT.docx");
}
/// <summary>
/// Use a document builder to insert an INCLUDETEXT field with custom properties.
/// </summary>
public FieldIncludeText CreateFieldIncludeText(DocumentBuilder builder, string sourceFullName, bool lockFields, string mimeType, string textConverter, string encoding)
{
FieldIncludeText fieldIncludeText = (FieldIncludeText)builder.InsertField(FieldType.FieldIncludeText, true);
fieldIncludeText.SourceFullName = sourceFullName;
fieldIncludeText.LockFields = lockFields;
fieldIncludeText.MimeType = mimeType;
fieldIncludeText.TextConverter = textConverter;
fieldIncludeText.Encoding = encoding;
return fieldIncludeText;
}
See Also
- class FieldIncludeText
- namespace Aspose.Words.Fields
- assembly Aspose.Words