public class FieldIncludeText extends Field
To learn more, visit the Working with Fields documentation article.
Remarks:
Inserts all or part of the text and graphics contained in another document.
Examples:
Shows how to create an INCLUDETEXT field, and set its properties.
public void fieldIncludeText() throws Exception {
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, getMyDir() + "CD collection data.xml", false, "text/xml", "XML", "ISO-8859-1");
fieldIncludeText.setXslTransformation(getMyDir() + "CD collection XSL transformation.xsl");
builder.writeln();
// 2 - Use an XPath to take specific elements from an XML document:
fieldIncludeText = createFieldIncludeText(builder, getMyDir() + "CD collection data.xml", false, "text/xml", "XML", "ISO-8859-1");
fieldIncludeText.setNamespaceMappings("xmlns:n='myNamespace'");
fieldIncludeText.setXPath("/catalog/cd/title");
doc.updateFields();
doc.save(getArtifactsDir() + "Field.INCLUDETEXT.docx");
}
/// <summary>
/// Use a document builder to insert an INCLUDETEXT field with custom properties.
/// </summary>
public FieldIncludeText createFieldIncludeText(DocumentBuilder builder, String sourceFullName, boolean lockFields, String mimeType, String textConverter, String encoding) throws Exception {
FieldIncludeText fieldIncludeText = (FieldIncludeText) builder.insertField(FieldType.FIELD_INCLUDE_TEXT, true);
fieldIncludeText.setSourceFullName(sourceFullName);
fieldIncludeText.setLockFields(lockFields);
fieldIncludeText.setMimeType(mimeType);
fieldIncludeText.setTextConverter(textConverter);
fieldIncludeText.setEncoding(encoding);
return fieldIncludeText;
}
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
getBookmarkName()
Gets the name of the bookmark in the document to include.
|
java.lang.String |
getEncoding()
Gets the encoding applied to the data within the referenced file.
|
boolean |
getLockFields()
Gets whether to prevent fields in the included document from being updated.
|
java.lang.String |
getMimeType()
Gets the MIME type of the referenced file.
|
java.lang.String |
getNamespaceMappings()
Gets the namespace mappings for XPath queries.
|
java.lang.String |
getSourceFullName()
Gets the location of the document using an IRI.
|
int |
getSourceFullNameArgumentIndex() |
int |
getSwitchType(java.lang.String switchName) |
java.lang.String |
getTextConverter()
Gets the name of the text converter for the format of the included file.
|
java.lang.String |
getXPath()
Gets XPath for the desired portion of the XML file.
|
java.lang.String |
getXslTransformation()
Gets the location of XSL Transformation to format XML data.
|
void |
setBookmarkName(java.lang.String value)
Sets the name of the bookmark in the document to include.
|
void |
setEncoding(java.lang.String value)
Sets the encoding applied to the data within the referenced file.
|
void |
setLockFields(boolean value)
Sets whether to prevent fields in the included document from being updated.
|
void |
setMimeType(java.lang.String value)
Sets the MIME type of the referenced file.
|
void |
setNamespaceMappings(java.lang.String value)
Sets the namespace mappings for XPath queries.
|
void |
setSourceFullName(java.lang.String value)
Sets the location of the document using an IRI.
|
void |
setTextConverter(java.lang.String value)
Sets the name of the text converter for the format of the included file.
|
void |
setXPath(java.lang.String value)
Sets XPath for the desired portion of the XML file.
|
void |
setXslTransformation(java.lang.String value)
Sets the location of XSL Transformation to format XML data.
|
getDisplayResult, getEnd, getFieldCode, getFieldCode, getFormat, getLocaleId, getResult, getSeparator, getStart, getType, isDirty, isDirty, isLocked, isLocked, needStoreOldResultNodes, remove, setLocaleId, setResult, unlink, update, updatepublic java.lang.String getSourceFullName()
Examples:
Shows how to create an INCLUDETEXT field, and set its properties.
public void fieldIncludeText() throws Exception {
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, getMyDir() + "CD collection data.xml", false, "text/xml", "XML", "ISO-8859-1");
fieldIncludeText.setXslTransformation(getMyDir() + "CD collection XSL transformation.xsl");
builder.writeln();
// 2 - Use an XPath to take specific elements from an XML document:
fieldIncludeText = createFieldIncludeText(builder, getMyDir() + "CD collection data.xml", false, "text/xml", "XML", "ISO-8859-1");
fieldIncludeText.setNamespaceMappings("xmlns:n='myNamespace'");
fieldIncludeText.setXPath("/catalog/cd/title");
doc.updateFields();
doc.save(getArtifactsDir() + "Field.INCLUDETEXT.docx");
}
/// <summary>
/// Use a document builder to insert an INCLUDETEXT field with custom properties.
/// </summary>
public FieldIncludeText createFieldIncludeText(DocumentBuilder builder, String sourceFullName, boolean lockFields, String mimeType, String textConverter, String encoding) throws Exception {
FieldIncludeText fieldIncludeText = (FieldIncludeText) builder.insertField(FieldType.FIELD_INCLUDE_TEXT, true);
fieldIncludeText.setSourceFullName(sourceFullName);
fieldIncludeText.setLockFields(lockFields);
fieldIncludeText.setMimeType(mimeType);
fieldIncludeText.setTextConverter(textConverter);
fieldIncludeText.setEncoding(encoding);
return fieldIncludeText;
}
public void setSourceFullName(java.lang.String value)
throws java.lang.Exception
Examples:
Shows how to create an INCLUDETEXT field, and set its properties.
public void fieldIncludeText() throws Exception {
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, getMyDir() + "CD collection data.xml", false, "text/xml", "XML", "ISO-8859-1");
fieldIncludeText.setXslTransformation(getMyDir() + "CD collection XSL transformation.xsl");
builder.writeln();
// 2 - Use an XPath to take specific elements from an XML document:
fieldIncludeText = createFieldIncludeText(builder, getMyDir() + "CD collection data.xml", false, "text/xml", "XML", "ISO-8859-1");
fieldIncludeText.setNamespaceMappings("xmlns:n='myNamespace'");
fieldIncludeText.setXPath("/catalog/cd/title");
doc.updateFields();
doc.save(getArtifactsDir() + "Field.INCLUDETEXT.docx");
}
/// <summary>
/// Use a document builder to insert an INCLUDETEXT field with custom properties.
/// </summary>
public FieldIncludeText createFieldIncludeText(DocumentBuilder builder, String sourceFullName, boolean lockFields, String mimeType, String textConverter, String encoding) throws Exception {
FieldIncludeText fieldIncludeText = (FieldIncludeText) builder.insertField(FieldType.FIELD_INCLUDE_TEXT, true);
fieldIncludeText.setSourceFullName(sourceFullName);
fieldIncludeText.setLockFields(lockFields);
fieldIncludeText.setMimeType(mimeType);
fieldIncludeText.setTextConverter(textConverter);
fieldIncludeText.setEncoding(encoding);
return fieldIncludeText;
}
value - The location of the document using an IRI.java.lang.Exceptionpublic java.lang.String getBookmarkName()
Examples:
Shows how to create an INCLUDETEXT field, and set its properties.
public void fieldIncludeText() throws Exception {
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, getMyDir() + "CD collection data.xml", false, "text/xml", "XML", "ISO-8859-1");
fieldIncludeText.setXslTransformation(getMyDir() + "CD collection XSL transformation.xsl");
builder.writeln();
// 2 - Use an XPath to take specific elements from an XML document:
fieldIncludeText = createFieldIncludeText(builder, getMyDir() + "CD collection data.xml", false, "text/xml", "XML", "ISO-8859-1");
fieldIncludeText.setNamespaceMappings("xmlns:n='myNamespace'");
fieldIncludeText.setXPath("/catalog/cd/title");
doc.updateFields();
doc.save(getArtifactsDir() + "Field.INCLUDETEXT.docx");
}
/// <summary>
/// Use a document builder to insert an INCLUDETEXT field with custom properties.
/// </summary>
public FieldIncludeText createFieldIncludeText(DocumentBuilder builder, String sourceFullName, boolean lockFields, String mimeType, String textConverter, String encoding) throws Exception {
FieldIncludeText fieldIncludeText = (FieldIncludeText) builder.insertField(FieldType.FIELD_INCLUDE_TEXT, true);
fieldIncludeText.setSourceFullName(sourceFullName);
fieldIncludeText.setLockFields(lockFields);
fieldIncludeText.setMimeType(mimeType);
fieldIncludeText.setTextConverter(textConverter);
fieldIncludeText.setEncoding(encoding);
return fieldIncludeText;
}
public void setBookmarkName(java.lang.String value)
throws java.lang.Exception
Examples:
Shows how to create an INCLUDETEXT field, and set its properties.
public void fieldIncludeText() throws Exception {
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, getMyDir() + "CD collection data.xml", false, "text/xml", "XML", "ISO-8859-1");
fieldIncludeText.setXslTransformation(getMyDir() + "CD collection XSL transformation.xsl");
builder.writeln();
// 2 - Use an XPath to take specific elements from an XML document:
fieldIncludeText = createFieldIncludeText(builder, getMyDir() + "CD collection data.xml", false, "text/xml", "XML", "ISO-8859-1");
fieldIncludeText.setNamespaceMappings("xmlns:n='myNamespace'");
fieldIncludeText.setXPath("/catalog/cd/title");
doc.updateFields();
doc.save(getArtifactsDir() + "Field.INCLUDETEXT.docx");
}
/// <summary>
/// Use a document builder to insert an INCLUDETEXT field with custom properties.
/// </summary>
public FieldIncludeText createFieldIncludeText(DocumentBuilder builder, String sourceFullName, boolean lockFields, String mimeType, String textConverter, String encoding) throws Exception {
FieldIncludeText fieldIncludeText = (FieldIncludeText) builder.insertField(FieldType.FIELD_INCLUDE_TEXT, true);
fieldIncludeText.setSourceFullName(sourceFullName);
fieldIncludeText.setLockFields(lockFields);
fieldIncludeText.setMimeType(mimeType);
fieldIncludeText.setTextConverter(textConverter);
fieldIncludeText.setEncoding(encoding);
return fieldIncludeText;
}
value - The name of the bookmark in the document to include.java.lang.Exceptionpublic boolean getLockFields()
Examples:
Shows how to create an INCLUDETEXT field, and set its properties.
public void fieldIncludeText() throws Exception {
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, getMyDir() + "CD collection data.xml", false, "text/xml", "XML", "ISO-8859-1");
fieldIncludeText.setXslTransformation(getMyDir() + "CD collection XSL transformation.xsl");
builder.writeln();
// 2 - Use an XPath to take specific elements from an XML document:
fieldIncludeText = createFieldIncludeText(builder, getMyDir() + "CD collection data.xml", false, "text/xml", "XML", "ISO-8859-1");
fieldIncludeText.setNamespaceMappings("xmlns:n='myNamespace'");
fieldIncludeText.setXPath("/catalog/cd/title");
doc.updateFields();
doc.save(getArtifactsDir() + "Field.INCLUDETEXT.docx");
}
/// <summary>
/// Use a document builder to insert an INCLUDETEXT field with custom properties.
/// </summary>
public FieldIncludeText createFieldIncludeText(DocumentBuilder builder, String sourceFullName, boolean lockFields, String mimeType, String textConverter, String encoding) throws Exception {
FieldIncludeText fieldIncludeText = (FieldIncludeText) builder.insertField(FieldType.FIELD_INCLUDE_TEXT, true);
fieldIncludeText.setSourceFullName(sourceFullName);
fieldIncludeText.setLockFields(lockFields);
fieldIncludeText.setMimeType(mimeType);
fieldIncludeText.setTextConverter(textConverter);
fieldIncludeText.setEncoding(encoding);
return fieldIncludeText;
}
public void setLockFields(boolean value)
throws java.lang.Exception
Examples:
Shows how to create an INCLUDETEXT field, and set its properties.
public void fieldIncludeText() throws Exception {
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, getMyDir() + "CD collection data.xml", false, "text/xml", "XML", "ISO-8859-1");
fieldIncludeText.setXslTransformation(getMyDir() + "CD collection XSL transformation.xsl");
builder.writeln();
// 2 - Use an XPath to take specific elements from an XML document:
fieldIncludeText = createFieldIncludeText(builder, getMyDir() + "CD collection data.xml", false, "text/xml", "XML", "ISO-8859-1");
fieldIncludeText.setNamespaceMappings("xmlns:n='myNamespace'");
fieldIncludeText.setXPath("/catalog/cd/title");
doc.updateFields();
doc.save(getArtifactsDir() + "Field.INCLUDETEXT.docx");
}
/// <summary>
/// Use a document builder to insert an INCLUDETEXT field with custom properties.
/// </summary>
public FieldIncludeText createFieldIncludeText(DocumentBuilder builder, String sourceFullName, boolean lockFields, String mimeType, String textConverter, String encoding) throws Exception {
FieldIncludeText fieldIncludeText = (FieldIncludeText) builder.insertField(FieldType.FIELD_INCLUDE_TEXT, true);
fieldIncludeText.setSourceFullName(sourceFullName);
fieldIncludeText.setLockFields(lockFields);
fieldIncludeText.setMimeType(mimeType);
fieldIncludeText.setTextConverter(textConverter);
fieldIncludeText.setEncoding(encoding);
return fieldIncludeText;
}
value - Whether to prevent fields in the included document from being updated.java.lang.Exceptionpublic java.lang.String getTextConverter()
Examples:
Shows how to create an INCLUDETEXT field, and set its properties.
public void fieldIncludeText() throws Exception {
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, getMyDir() + "CD collection data.xml", false, "text/xml", "XML", "ISO-8859-1");
fieldIncludeText.setXslTransformation(getMyDir() + "CD collection XSL transformation.xsl");
builder.writeln();
// 2 - Use an XPath to take specific elements from an XML document:
fieldIncludeText = createFieldIncludeText(builder, getMyDir() + "CD collection data.xml", false, "text/xml", "XML", "ISO-8859-1");
fieldIncludeText.setNamespaceMappings("xmlns:n='myNamespace'");
fieldIncludeText.setXPath("/catalog/cd/title");
doc.updateFields();
doc.save(getArtifactsDir() + "Field.INCLUDETEXT.docx");
}
/// <summary>
/// Use a document builder to insert an INCLUDETEXT field with custom properties.
/// </summary>
public FieldIncludeText createFieldIncludeText(DocumentBuilder builder, String sourceFullName, boolean lockFields, String mimeType, String textConverter, String encoding) throws Exception {
FieldIncludeText fieldIncludeText = (FieldIncludeText) builder.insertField(FieldType.FIELD_INCLUDE_TEXT, true);
fieldIncludeText.setSourceFullName(sourceFullName);
fieldIncludeText.setLockFields(lockFields);
fieldIncludeText.setMimeType(mimeType);
fieldIncludeText.setTextConverter(textConverter);
fieldIncludeText.setEncoding(encoding);
return fieldIncludeText;
}
public void setTextConverter(java.lang.String value)
throws java.lang.Exception
Examples:
Shows how to create an INCLUDETEXT field, and set its properties.
public void fieldIncludeText() throws Exception {
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, getMyDir() + "CD collection data.xml", false, "text/xml", "XML", "ISO-8859-1");
fieldIncludeText.setXslTransformation(getMyDir() + "CD collection XSL transformation.xsl");
builder.writeln();
// 2 - Use an XPath to take specific elements from an XML document:
fieldIncludeText = createFieldIncludeText(builder, getMyDir() + "CD collection data.xml", false, "text/xml", "XML", "ISO-8859-1");
fieldIncludeText.setNamespaceMappings("xmlns:n='myNamespace'");
fieldIncludeText.setXPath("/catalog/cd/title");
doc.updateFields();
doc.save(getArtifactsDir() + "Field.INCLUDETEXT.docx");
}
/// <summary>
/// Use a document builder to insert an INCLUDETEXT field with custom properties.
/// </summary>
public FieldIncludeText createFieldIncludeText(DocumentBuilder builder, String sourceFullName, boolean lockFields, String mimeType, String textConverter, String encoding) throws Exception {
FieldIncludeText fieldIncludeText = (FieldIncludeText) builder.insertField(FieldType.FIELD_INCLUDE_TEXT, true);
fieldIncludeText.setSourceFullName(sourceFullName);
fieldIncludeText.setLockFields(lockFields);
fieldIncludeText.setMimeType(mimeType);
fieldIncludeText.setTextConverter(textConverter);
fieldIncludeText.setEncoding(encoding);
return fieldIncludeText;
}
value - The name of the text converter for the format of the included file.java.lang.Exceptionpublic java.lang.String getNamespaceMappings()
Examples:
Shows how to create an INCLUDETEXT field, and set its properties.
public void fieldIncludeText() throws Exception {
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, getMyDir() + "CD collection data.xml", false, "text/xml", "XML", "ISO-8859-1");
fieldIncludeText.setXslTransformation(getMyDir() + "CD collection XSL transformation.xsl");
builder.writeln();
// 2 - Use an XPath to take specific elements from an XML document:
fieldIncludeText = createFieldIncludeText(builder, getMyDir() + "CD collection data.xml", false, "text/xml", "XML", "ISO-8859-1");
fieldIncludeText.setNamespaceMappings("xmlns:n='myNamespace'");
fieldIncludeText.setXPath("/catalog/cd/title");
doc.updateFields();
doc.save(getArtifactsDir() + "Field.INCLUDETEXT.docx");
}
/// <summary>
/// Use a document builder to insert an INCLUDETEXT field with custom properties.
/// </summary>
public FieldIncludeText createFieldIncludeText(DocumentBuilder builder, String sourceFullName, boolean lockFields, String mimeType, String textConverter, String encoding) throws Exception {
FieldIncludeText fieldIncludeText = (FieldIncludeText) builder.insertField(FieldType.FIELD_INCLUDE_TEXT, true);
fieldIncludeText.setSourceFullName(sourceFullName);
fieldIncludeText.setLockFields(lockFields);
fieldIncludeText.setMimeType(mimeType);
fieldIncludeText.setTextConverter(textConverter);
fieldIncludeText.setEncoding(encoding);
return fieldIncludeText;
}
public void setNamespaceMappings(java.lang.String value)
throws java.lang.Exception
Examples:
Shows how to create an INCLUDETEXT field, and set its properties.
public void fieldIncludeText() throws Exception {
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, getMyDir() + "CD collection data.xml", false, "text/xml", "XML", "ISO-8859-1");
fieldIncludeText.setXslTransformation(getMyDir() + "CD collection XSL transformation.xsl");
builder.writeln();
// 2 - Use an XPath to take specific elements from an XML document:
fieldIncludeText = createFieldIncludeText(builder, getMyDir() + "CD collection data.xml", false, "text/xml", "XML", "ISO-8859-1");
fieldIncludeText.setNamespaceMappings("xmlns:n='myNamespace'");
fieldIncludeText.setXPath("/catalog/cd/title");
doc.updateFields();
doc.save(getArtifactsDir() + "Field.INCLUDETEXT.docx");
}
/// <summary>
/// Use a document builder to insert an INCLUDETEXT field with custom properties.
/// </summary>
public FieldIncludeText createFieldIncludeText(DocumentBuilder builder, String sourceFullName, boolean lockFields, String mimeType, String textConverter, String encoding) throws Exception {
FieldIncludeText fieldIncludeText = (FieldIncludeText) builder.insertField(FieldType.FIELD_INCLUDE_TEXT, true);
fieldIncludeText.setSourceFullName(sourceFullName);
fieldIncludeText.setLockFields(lockFields);
fieldIncludeText.setMimeType(mimeType);
fieldIncludeText.setTextConverter(textConverter);
fieldIncludeText.setEncoding(encoding);
return fieldIncludeText;
}
value - The namespace mappings for XPath queries.java.lang.Exceptionpublic java.lang.String getXslTransformation()
Examples:
Shows how to create an INCLUDETEXT field, and set its properties.
public void fieldIncludeText() throws Exception {
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, getMyDir() + "CD collection data.xml", false, "text/xml", "XML", "ISO-8859-1");
fieldIncludeText.setXslTransformation(getMyDir() + "CD collection XSL transformation.xsl");
builder.writeln();
// 2 - Use an XPath to take specific elements from an XML document:
fieldIncludeText = createFieldIncludeText(builder, getMyDir() + "CD collection data.xml", false, "text/xml", "XML", "ISO-8859-1");
fieldIncludeText.setNamespaceMappings("xmlns:n='myNamespace'");
fieldIncludeText.setXPath("/catalog/cd/title");
doc.updateFields();
doc.save(getArtifactsDir() + "Field.INCLUDETEXT.docx");
}
/// <summary>
/// Use a document builder to insert an INCLUDETEXT field with custom properties.
/// </summary>
public FieldIncludeText createFieldIncludeText(DocumentBuilder builder, String sourceFullName, boolean lockFields, String mimeType, String textConverter, String encoding) throws Exception {
FieldIncludeText fieldIncludeText = (FieldIncludeText) builder.insertField(FieldType.FIELD_INCLUDE_TEXT, true);
fieldIncludeText.setSourceFullName(sourceFullName);
fieldIncludeText.setLockFields(lockFields);
fieldIncludeText.setMimeType(mimeType);
fieldIncludeText.setTextConverter(textConverter);
fieldIncludeText.setEncoding(encoding);
return fieldIncludeText;
}
public void setXslTransformation(java.lang.String value)
throws java.lang.Exception
Examples:
Shows how to create an INCLUDETEXT field, and set its properties.
public void fieldIncludeText() throws Exception {
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, getMyDir() + "CD collection data.xml", false, "text/xml", "XML", "ISO-8859-1");
fieldIncludeText.setXslTransformation(getMyDir() + "CD collection XSL transformation.xsl");
builder.writeln();
// 2 - Use an XPath to take specific elements from an XML document:
fieldIncludeText = createFieldIncludeText(builder, getMyDir() + "CD collection data.xml", false, "text/xml", "XML", "ISO-8859-1");
fieldIncludeText.setNamespaceMappings("xmlns:n='myNamespace'");
fieldIncludeText.setXPath("/catalog/cd/title");
doc.updateFields();
doc.save(getArtifactsDir() + "Field.INCLUDETEXT.docx");
}
/// <summary>
/// Use a document builder to insert an INCLUDETEXT field with custom properties.
/// </summary>
public FieldIncludeText createFieldIncludeText(DocumentBuilder builder, String sourceFullName, boolean lockFields, String mimeType, String textConverter, String encoding) throws Exception {
FieldIncludeText fieldIncludeText = (FieldIncludeText) builder.insertField(FieldType.FIELD_INCLUDE_TEXT, true);
fieldIncludeText.setSourceFullName(sourceFullName);
fieldIncludeText.setLockFields(lockFields);
fieldIncludeText.setMimeType(mimeType);
fieldIncludeText.setTextConverter(textConverter);
fieldIncludeText.setEncoding(encoding);
return fieldIncludeText;
}
value - The location of XSL Transformation to format XML data.java.lang.Exceptionpublic java.lang.String getXPath()
Examples:
Shows how to create an INCLUDETEXT field, and set its properties.
public void fieldIncludeText() throws Exception {
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, getMyDir() + "CD collection data.xml", false, "text/xml", "XML", "ISO-8859-1");
fieldIncludeText.setXslTransformation(getMyDir() + "CD collection XSL transformation.xsl");
builder.writeln();
// 2 - Use an XPath to take specific elements from an XML document:
fieldIncludeText = createFieldIncludeText(builder, getMyDir() + "CD collection data.xml", false, "text/xml", "XML", "ISO-8859-1");
fieldIncludeText.setNamespaceMappings("xmlns:n='myNamespace'");
fieldIncludeText.setXPath("/catalog/cd/title");
doc.updateFields();
doc.save(getArtifactsDir() + "Field.INCLUDETEXT.docx");
}
/// <summary>
/// Use a document builder to insert an INCLUDETEXT field with custom properties.
/// </summary>
public FieldIncludeText createFieldIncludeText(DocumentBuilder builder, String sourceFullName, boolean lockFields, String mimeType, String textConverter, String encoding) throws Exception {
FieldIncludeText fieldIncludeText = (FieldIncludeText) builder.insertField(FieldType.FIELD_INCLUDE_TEXT, true);
fieldIncludeText.setSourceFullName(sourceFullName);
fieldIncludeText.setLockFields(lockFields);
fieldIncludeText.setMimeType(mimeType);
fieldIncludeText.setTextConverter(textConverter);
fieldIncludeText.setEncoding(encoding);
return fieldIncludeText;
}
public void setXPath(java.lang.String value)
throws java.lang.Exception
Examples:
Shows how to create an INCLUDETEXT field, and set its properties.
public void fieldIncludeText() throws Exception {
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, getMyDir() + "CD collection data.xml", false, "text/xml", "XML", "ISO-8859-1");
fieldIncludeText.setXslTransformation(getMyDir() + "CD collection XSL transformation.xsl");
builder.writeln();
// 2 - Use an XPath to take specific elements from an XML document:
fieldIncludeText = createFieldIncludeText(builder, getMyDir() + "CD collection data.xml", false, "text/xml", "XML", "ISO-8859-1");
fieldIncludeText.setNamespaceMappings("xmlns:n='myNamespace'");
fieldIncludeText.setXPath("/catalog/cd/title");
doc.updateFields();
doc.save(getArtifactsDir() + "Field.INCLUDETEXT.docx");
}
/// <summary>
/// Use a document builder to insert an INCLUDETEXT field with custom properties.
/// </summary>
public FieldIncludeText createFieldIncludeText(DocumentBuilder builder, String sourceFullName, boolean lockFields, String mimeType, String textConverter, String encoding) throws Exception {
FieldIncludeText fieldIncludeText = (FieldIncludeText) builder.insertField(FieldType.FIELD_INCLUDE_TEXT, true);
fieldIncludeText.setSourceFullName(sourceFullName);
fieldIncludeText.setLockFields(lockFields);
fieldIncludeText.setMimeType(mimeType);
fieldIncludeText.setTextConverter(textConverter);
fieldIncludeText.setEncoding(encoding);
return fieldIncludeText;
}
value - XPath for the desired portion of the XML file.java.lang.Exceptionpublic java.lang.String getEncoding()
Examples:
Shows how to create an INCLUDETEXT field, and set its properties.
public void fieldIncludeText() throws Exception {
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, getMyDir() + "CD collection data.xml", false, "text/xml", "XML", "ISO-8859-1");
fieldIncludeText.setXslTransformation(getMyDir() + "CD collection XSL transformation.xsl");
builder.writeln();
// 2 - Use an XPath to take specific elements from an XML document:
fieldIncludeText = createFieldIncludeText(builder, getMyDir() + "CD collection data.xml", false, "text/xml", "XML", "ISO-8859-1");
fieldIncludeText.setNamespaceMappings("xmlns:n='myNamespace'");
fieldIncludeText.setXPath("/catalog/cd/title");
doc.updateFields();
doc.save(getArtifactsDir() + "Field.INCLUDETEXT.docx");
}
/// <summary>
/// Use a document builder to insert an INCLUDETEXT field with custom properties.
/// </summary>
public FieldIncludeText createFieldIncludeText(DocumentBuilder builder, String sourceFullName, boolean lockFields, String mimeType, String textConverter, String encoding) throws Exception {
FieldIncludeText fieldIncludeText = (FieldIncludeText) builder.insertField(FieldType.FIELD_INCLUDE_TEXT, true);
fieldIncludeText.setSourceFullName(sourceFullName);
fieldIncludeText.setLockFields(lockFields);
fieldIncludeText.setMimeType(mimeType);
fieldIncludeText.setTextConverter(textConverter);
fieldIncludeText.setEncoding(encoding);
return fieldIncludeText;
}
public void setEncoding(java.lang.String value)
throws java.lang.Exception
Examples:
Shows how to create an INCLUDETEXT field, and set its properties.
public void fieldIncludeText() throws Exception {
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, getMyDir() + "CD collection data.xml", false, "text/xml", "XML", "ISO-8859-1");
fieldIncludeText.setXslTransformation(getMyDir() + "CD collection XSL transformation.xsl");
builder.writeln();
// 2 - Use an XPath to take specific elements from an XML document:
fieldIncludeText = createFieldIncludeText(builder, getMyDir() + "CD collection data.xml", false, "text/xml", "XML", "ISO-8859-1");
fieldIncludeText.setNamespaceMappings("xmlns:n='myNamespace'");
fieldIncludeText.setXPath("/catalog/cd/title");
doc.updateFields();
doc.save(getArtifactsDir() + "Field.INCLUDETEXT.docx");
}
/// <summary>
/// Use a document builder to insert an INCLUDETEXT field with custom properties.
/// </summary>
public FieldIncludeText createFieldIncludeText(DocumentBuilder builder, String sourceFullName, boolean lockFields, String mimeType, String textConverter, String encoding) throws Exception {
FieldIncludeText fieldIncludeText = (FieldIncludeText) builder.insertField(FieldType.FIELD_INCLUDE_TEXT, true);
fieldIncludeText.setSourceFullName(sourceFullName);
fieldIncludeText.setLockFields(lockFields);
fieldIncludeText.setMimeType(mimeType);
fieldIncludeText.setTextConverter(textConverter);
fieldIncludeText.setEncoding(encoding);
return fieldIncludeText;
}
value - The encoding applied to the data within the referenced file.java.lang.Exceptionpublic java.lang.String getMimeType()
Examples:
Shows how to create an INCLUDETEXT field, and set its properties.
public void fieldIncludeText() throws Exception {
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, getMyDir() + "CD collection data.xml", false, "text/xml", "XML", "ISO-8859-1");
fieldIncludeText.setXslTransformation(getMyDir() + "CD collection XSL transformation.xsl");
builder.writeln();
// 2 - Use an XPath to take specific elements from an XML document:
fieldIncludeText = createFieldIncludeText(builder, getMyDir() + "CD collection data.xml", false, "text/xml", "XML", "ISO-8859-1");
fieldIncludeText.setNamespaceMappings("xmlns:n='myNamespace'");
fieldIncludeText.setXPath("/catalog/cd/title");
doc.updateFields();
doc.save(getArtifactsDir() + "Field.INCLUDETEXT.docx");
}
/// <summary>
/// Use a document builder to insert an INCLUDETEXT field with custom properties.
/// </summary>
public FieldIncludeText createFieldIncludeText(DocumentBuilder builder, String sourceFullName, boolean lockFields, String mimeType, String textConverter, String encoding) throws Exception {
FieldIncludeText fieldIncludeText = (FieldIncludeText) builder.insertField(FieldType.FIELD_INCLUDE_TEXT, true);
fieldIncludeText.setSourceFullName(sourceFullName);
fieldIncludeText.setLockFields(lockFields);
fieldIncludeText.setMimeType(mimeType);
fieldIncludeText.setTextConverter(textConverter);
fieldIncludeText.setEncoding(encoding);
return fieldIncludeText;
}
public void setMimeType(java.lang.String value)
throws java.lang.Exception
Examples:
Shows how to create an INCLUDETEXT field, and set its properties.
public void fieldIncludeText() throws Exception {
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, getMyDir() + "CD collection data.xml", false, "text/xml", "XML", "ISO-8859-1");
fieldIncludeText.setXslTransformation(getMyDir() + "CD collection XSL transformation.xsl");
builder.writeln();
// 2 - Use an XPath to take specific elements from an XML document:
fieldIncludeText = createFieldIncludeText(builder, getMyDir() + "CD collection data.xml", false, "text/xml", "XML", "ISO-8859-1");
fieldIncludeText.setNamespaceMappings("xmlns:n='myNamespace'");
fieldIncludeText.setXPath("/catalog/cd/title");
doc.updateFields();
doc.save(getArtifactsDir() + "Field.INCLUDETEXT.docx");
}
/// <summary>
/// Use a document builder to insert an INCLUDETEXT field with custom properties.
/// </summary>
public FieldIncludeText createFieldIncludeText(DocumentBuilder builder, String sourceFullName, boolean lockFields, String mimeType, String textConverter, String encoding) throws Exception {
FieldIncludeText fieldIncludeText = (FieldIncludeText) builder.insertField(FieldType.FIELD_INCLUDE_TEXT, true);
fieldIncludeText.setSourceFullName(sourceFullName);
fieldIncludeText.setLockFields(lockFields);
fieldIncludeText.setMimeType(mimeType);
fieldIncludeText.setTextConverter(textConverter);
fieldIncludeText.setEncoding(encoding);
return fieldIncludeText;
}
value - The MIME type of the referenced file.java.lang.Exceptionpublic int getSourceFullNameArgumentIndex()
public int getSwitchType(java.lang.String switchName)