com.aspose.words.CompositeNode
com.aspose.words.StructuredDocumentTag
public class StructuredDocumentTag
- extends com.aspose.words.CompositeNode
Represents a structured document tag (SDT or content control) in a document.
Structured document tags (SDTs) allow to embed customer-defined semantics as well as its
behavior and appearance into a document.
In this version Aspose.Words provides a number of public methods and properties to
manipulate the behavior and content of StructuredDocumentTag.
Mapping of SDT nodes to custom XML packages within a document can be performed with using
the XmlMapping property.
StructuredDocumentTag can occur in a document in the following places:
- Block-level - Among paragraphs and tables, as a child of a Aspose.Words.Body, Aspose.Words.HeaderFooter,
Aspose.Words.Comment, Aspose.Words.Footnote or a Shape node.
- Row-level - Among rows in a table, as a child of a Table node.
- Cell-level - Among cells in a table row, as a child of a Row node.
- Inline-level - Among inline content inside, as a child of a Aspose.Words.Paragraph.
- Nested inside another StructuredDocumentTag.
Property Getters/Setters Summary |
java.lang.String | getBuildingBlockCategory() | |
void | setBuildingBlockCategory(java.lang.String value) | |
|
Specifies category of building block for this SDT node.
Can not be null.
|
java.lang.String | getBuildingBlockGallery() | |
void | setBuildingBlockGallery(java.lang.String value) | |
|
Specifies type of building block for this SDT.
Can not be null.
|
int | getCalendarType() | |
void | setCalendarType(int value) | |
|
Specifies the type of calendar for this SDT.
Default is SdtCalendarType.DEFAULTThe value of the property is SdtCalendarType integer constant. |
boolean | getChecked() | |
void | setChecked(boolean value) | |
|
Gets/Sets current state of the Checkbox SDT.
Default value for this property is false.
|
Aspose.Words.NodeCollection | getChildNodes() | → inherited from Aspose.Words.CompositeNode |
|
Gets all immediate child nodes of this node.
|
Aspose.Words.Font | getContentsFont() | |
|
Font formatting that will be applied to text entered into SDT.
|
int | getCount() | → inherited from Aspose.Words.CompositeNode |
|
Gets the number of immediate children of this node.
|
java.lang.String | getDateDisplayFormat() | |
void | setDateDisplayFormat(java.lang.String value) | |
|
String that represents the format in which dates are displayed.
Can not be null.
Example: The dates for English (U.S.) is "mm/dd/yyyy" |
int | getDateDisplayLocale() | |
void | setDateDisplayLocale(int value) | |
|
Allows to set/get the language format for the date displayed in this SDT.
|
int | getDateStorageFormat() | |
void | setDateStorageFormat(int value) | |
|
Gets/sets format in which the date for a date SDT is stored when the SDT is bound to an XML node in the document's data store.
Default value is SdtDateStorageFormat.DATE_TIMEThe value of the property is SdtDateStorageFormat integer constant. |
Aspose.Words.DocumentBase | getDocument() | → inherited from Aspose.Words.Node |
|
Gets the document to which this node belongs.
|
Aspose.Words.Font | getEndCharacterFont() | |
|
Font formatting that will be applied to the last character of text entered into SDT.
|
Aspose.Words.Node | getFirstChild() | → inherited from Aspose.Words.CompositeNode |
|
Gets the first child of the node.
|
java.util.Date | getFullDate() | |
void | setFullDate(java.util.Date value) | |
|
Specifies the full date and time last entered into this SDT.
|
boolean | hasChildNodes() | → inherited from Aspose.Words.CompositeNode |
|
Returns true if this node has any child nodes.
|
int | getId() | |
| Specifies a unique readonly persistent numerical Id for this SDT. |
boolean | isComposite() | → inherited from Aspose.Words.CompositeNode |
|
Returns true as this node can have child nodes.
|
boolean | isShowingPlaceholderText() | |
void | isShowingPlaceholderText(boolean value) | |
|
Specifies whether the content of this SDT shall be interpreted to contain placeholder text
(as opposed to regular text contents within the SDT).
if set to true, this state shall be resumed (showing placeholder text) upon opening this document.
|
boolean | isTemporary() | |
void | isTemporary(boolean value) | |
|
Specifies whether this SDT shall be removed from the WordprocessingML document when its contents are modified.
|
Aspose.Words.Node | getLastChild() | → inherited from Aspose.Words.CompositeNode |
|
Gets the last child of the node.
|
int | getLevel() | |
|
Gets the level at which this SDT occurs in the document tree.
The value of the property is MarkupLevel integer constant. |
SdtListItemCollection | getListItems() | |
|
Gets SdtListItemCollection associated with this SDT.
|
boolean | getLockContentControl() | |
void | setLockContentControl(boolean value) | |
|
When set to true, this property will prohibit a user from deleting this SDT.
|
boolean | getLockContents() | |
void | setLockContents(boolean value) | |
|
When set to true, this property will prohibit a user from editing the contents of this SDT.
|
boolean | getMultiline() | |
void | setMultiline(boolean value) | |
|
Specifies whether this SDT allows multiple lines of text.
|
Aspose.Words.Node | getNextSibling() | → inherited from Aspose.Words.Node |
|
Gets the node immediately following this node.
|
Aspose.Words.NodeType | getNodeType() | |
|
Returns NodeType.StructuredDocumentTag.
|
Aspose.Words.CompositeNode | getParentNode() | → inherited from Aspose.Words.Node |
|
Gets the immediate parent of this node.
|
Aspose.Words.BuildingBlocks.BuildingBlock | getPlaceholder() | |
|
Gets the Aspose.Words.BuildingBlocks.BuildingBlock containing placeholder text which should be displayed when this SDT run contents are empty,
the associated mapped XML element is empty as specified via the XmlMapping element
or the IsShowingPlaceholderText element is true.
|
java.lang.String | getPlaceholderName() | |
void | setPlaceholderName(java.lang.String value) | |
| Gets or sets Name of the Aspose.Words.BuildingBlocks.BuildingBlock containing placeholder text.
BuildingBlock with this name #Error Cref: P:Aspose.Words.BuildingBlocks.BuildingBlock.Name has to be present in the #Error Cref: P:Aspose.Words.Document.GlossaryDocument
otherwise System.InvalidOperationException will occur. |
Aspose.Words.Node | getPreviousSibling() | → inherited from Aspose.Words.Node |
|
Gets the node immediately preceding this node.
|
Aspose.Words.Range | getRange() | → inherited from Aspose.Words.Node |
|
Returns a Range object that represents the portion of a document that is contained in this node.
|
int | getSdtType() | |
|
Gets type of this Structured document tag.
The value of the property is SdtType integer constant. |
java.lang.String | getTag() | |
void | setTag(java.lang.String value) | |
|
Specifies a tag associated with the current SDT node.
Can not be null.
|
java.lang.String | getTitle() | |
void | setTitle(java.lang.String value) | |
|
Specifies the friendly name associated with this SDT.
Can not be null.
|
XmlMapping | getXmlMapping() | |
|
Gets an object that represents the mapping of this structured document tag to XML data
in a custom XML part of the current document.
|
Method Summary |
void | clear() | |
Clears contents of this structured document tag and displays a placeholder if it is defined.
|
void | dd() | → inherited from Aspose.Words.CompositeNode |
|
Aspose.Words.Node | deepClone(boolean isCloneChildren) | → inherited from Aspose.Words.Node |
Creates a duplicate of the node.
|
Aspose.Words.CompositeNode | getAncestor(java.lang.Class ancestorType) | → inherited from Aspose.Words.Node |
Gets the first ancestor of the specified object type.
|
Aspose.Words.CompositeNode | getContainer() | → inherited from Aspose.Words.CompositeNode |
Reserved for internal use. |
aspose.obfuscated.type | getDeleteRevision() | |
Reserved for internal use. |
aspose.obfuscated.type | getInsertRevision() | |
Reserved for internal use. |
int | getLevel_IMarkupNode() | |
Reserved for internal use. |
aspose.obfuscated.type | getMoveFromRevision() | |
Reserved for internal use. |
aspose.obfuscated.type | getMoveToRevision() | |
Reserved for internal use. |
Aspose.Words.Node | getNextMatchingNode(aspose.obfuscated.type curNode) | → inherited from Aspose.Words.CompositeNode |
Reserved for internal use. |
java.lang.String | getText() | → inherited from Aspose.Words.CompositeNode |
Gets the text of this node and of all its children.
|
java.util.Iterator | iterator() | → inherited from Aspose.Words.CompositeNode |
Provides support for the for each style iteration over the child nodes of this node.
|
void | remove() | → inherited from Aspose.Words.Node |
Removes itself from the parent.
|
void | removeAllChildren() | → inherited from Aspose.Words.CompositeNode |
Removes all the child nodes of the current node.
|
void | removeSelfOnly() | |
Removes just this SDT node itself, but keeps the content of it inside the document tree.
|
void | removeSmartTags() | → inherited from Aspose.Words.CompositeNode |
Removes all SmartTag descendant nodes of the current node.
|
Aspose.Words.NodeList | selectNodes(java.lang.String xpath) | → inherited from Aspose.Words.CompositeNode |
Selects a list of nodes matching the XPath expression.
|
Aspose.Words.Node | selectSingleNode(java.lang.String xpath) | → inherited from Aspose.Words.CompositeNode |
Selects the first Node that matches the XPath expression.
|
void | setDeleteRevision(aspose.obfuscated.type value) | |
Reserved for internal use. |
void | setInsertRevision(aspose.obfuscated.type value) | |
Reserved for internal use. |
void | setMoveFromRevision(aspose.obfuscated.type value) | |
Reserved for internal use. |
void | setMoveToRevision(aspose.obfuscated.type value) | |
Reserved for internal use. |
java.lang.String | toString() | |
|
java.lang.String | toString(SaveOptions saveOptions) | → inherited from Aspose.Words.Node |
Exports the content of the node into a string using the specified save options.
|
java.lang.String | toTxt() | → inherited from Aspose.Words.Node |
Exports the content of the node into a string in plain text format.
|
Property Getters/Setters Detail |
getBuildingBlockCategory/setBuildingBlockCategory | |
public java.lang.String getBuildingBlockCategory() / public void setBuildingBlockCategory(java.lang.String value)
|
-
Specifies category of building block for this SDT node.
Can not be null.
Accessing this property will only work for SdtType.BUILDING_BLOCK_GALLERY SDT type.
For all other SDT types exception will occur.
getBuildingBlockGallery/setBuildingBlockGallery | |
public java.lang.String getBuildingBlockGallery() / public void setBuildingBlockGallery(java.lang.String value)
|
-
Specifies type of building block for this SDT.
Can not be null.
Accessing this property will only work for SdtType.BUILDING_BLOCK_GALLERY SDT type.
For all other SDT types exception will occur.
getCalendarType/setCalendarType | |
public int getCalendarType() / public void setCalendarType(int value)
|
-
Specifies the type of calendar for this SDT.
Default is SdtCalendarType.DEFAULTThe value of the property is SdtCalendarType integer constant.
Accessing this property will only work for SdtType.DATE SDT type.
For all other SDT types exception will occur.
getChecked/setChecked | |
public boolean getChecked() / public void setChecked(boolean value)
|
-
Gets/Sets current state of the Checkbox SDT.
Default value for this property is false.
Accessing this property will only work for SdtType.CHECKBOX
SDT types.
For all other SDT types exception will occur.
getChildNodes | → inherited from Aspose.Words.CompositeNode |
public Aspose.Words.NodeCollection getChildNodes()
|
-
Gets all immediate child nodes of this node.
Note, #Error Cref: P:Aspose.Words.CompositeNode.ChildNodes is equivalent to calling GetChildNodes(NodeType.Any, false)
and creates and returns a new collection every time it is accessed.
If there are no child nodes, this property returns an empty collection.
getContentsFont | |
public Aspose.Words.Font getContentsFont()
|
-
Font formatting that will be applied to text entered into SDT.
getCount | → inherited from Aspose.Words.CompositeNode |
public int getCount()
|
-
Gets the number of immediate children of this node.
getDateDisplayFormat/setDateDisplayFormat | |
public java.lang.String getDateDisplayFormat() / public void setDateDisplayFormat(java.lang.String value)
|
-
String that represents the format in which dates are displayed.
Can not be null.
Example:
The dates for English (U.S.) is "mm/dd/yyyy"Accessing this property will only work for SdtType.DATE SDT type.
For all other SDT types exception will occur.
getDateDisplayLocale/setDateDisplayLocale | |
public int getDateDisplayLocale() / public void setDateDisplayLocale(int value)
|
-
Allows to set/get the language format for the date displayed in this SDT.
Accessing this property will only work for SdtType.DATE SDT type.
For all other SDT types exception will occur.
getDateStorageFormat/setDateStorageFormat | |
public int getDateStorageFormat() / public void setDateStorageFormat(int value)
|
-
Gets/sets format in which the date for a date SDT is stored when the SDT is bound to an XML node in the document's data store.
Default value is SdtDateStorageFormat.DATE_TIMEThe value of the property is SdtDateStorageFormat integer constant.
Accessing this property will only work for SdtType.DATE SDT type.
For all other SDT types exception will occur.
getDocument | → inherited from Aspose.Words.Node |
public Aspose.Words.DocumentBase getDocument()
|
-
Gets the document to which this node belongs.
The node always belongs to a document even if it has just been created
and not yet added to the tree, or if it has been removed from the tree.
getEndCharacterFont | |
public Aspose.Words.Font getEndCharacterFont()
|
-
Font formatting that will be applied to the last character of text entered into SDT.
getFirstChild | → inherited from Aspose.Words.CompositeNode |
public Aspose.Words.Node getFirstChild()
|
-
Gets the first child of the node.
If there is no first child node, a null is returned.
getFullDate/setFullDate | |
public java.util.Date getFullDate() / public void setFullDate(java.util.Date value)
|
-
Specifies the full date and time last entered into this SDT.
Accessing this property will only work for SdtType.DATE SDT type.
For all other SDT types exception will occur.
hasChildNodes | → inherited from Aspose.Words.CompositeNode |
public boolean hasChildNodes()
|
-
Returns true if this node has any child nodes.
Specifies a unique readonly persistent numerical Id for this SDT.
Id attribute shall follow these rules:
- The document shall retain SDT ids if the whole document is cloned #Error Cref: M:Aspose.Words.Document.Clone.
- During #Error Cref: M:Aspose.Words.DocumentBase.ImportNode(Aspose.Words.Node,System.Boolean)
Id shall be retained if import does not cause conflicts with other SDT Ids in
the target document.
-
If multiple SDT nodes specify the same decimal number value for the Id attribute,
then the first SDT in the document shall maintain this original Id,
and all subsequent SDT nodes shall have new identifiers assigned to them when the document is loaded.
- During#Error Cref: M:Aspose.Words.Markup.StructuredDocumentTag.Clone(System.Boolean,Aspose.Words.INodeCloningListener) operation new unique ID will be generated for the cloned SDT node.
-
If Id is not specified in the source document, then the SDT node shall have a new unique identifier assigned
to it when the document is loaded.
isComposite | → inherited from Aspose.Words.CompositeNode |
public boolean isComposite()
|
-
Returns true as this node can have child nodes.
isShowingPlaceholderText/isShowingPlaceholderText | |
public boolean isShowingPlaceholderText() / public void isShowingPlaceholderText(boolean value)
|
Specifies whether the content of this SDT shall be interpreted to contain placeholder text
(as opposed to regular text contents within the SDT).
if set to true, this state shall be resumed (showing placeholder text) upon opening this document.
isTemporary/isTemporary | |
public boolean isTemporary() / public void isTemporary(boolean value)
|
-
Specifies whether this SDT shall be removed from the WordprocessingML document when its contents are modified.
getLastChild | → inherited from Aspose.Words.CompositeNode |
public Aspose.Words.Node getLastChild()
|
-
Gets the last child of the node.
If there is no last child node, a null is returned.
getLevel | |
public int getLevel()
|
-
Gets the level at which this SDT occurs in the document tree.
The value of the property is MarkupLevel integer constant.
-
Gets SdtListItemCollection associated with this SDT.
Accessing this property will only work for SdtType.COMBO_BOX or SdtType.DROP_DOWN_LIST
SDT types.
For all other SDT types exception will occur.
getLockContentControl/setLockContentControl | |
public boolean getLockContentControl() / public void setLockContentControl(boolean value)
|
-
When set to true, this property will prohibit a user from deleting this SDT.
getLockContents/setLockContents | |
public boolean getLockContents() / public void setLockContents(boolean value)
|
-
When set to true, this property will prohibit a user from editing the contents of this SDT.
getMultiline/setMultiline | |
public boolean getMultiline() / public void setMultiline(boolean value)
|
-
Specifies whether this SDT allows multiple lines of text.
Accessing this property will only work for SdtType.RICH_TEXT and SdtType.PLAIN_TEXT SDT type.
For all other SDT types exception will occur.
getNextSibling | → inherited from Aspose.Words.Node |
public Aspose.Words.Node getNextSibling()
|
-
Gets the node immediately following this node.
If there is no next node, a null is returned.
getNodeType | |
public Aspose.Words.NodeType getNodeType()
|
-
Returns NodeType.StructuredDocumentTag.
getParentNode | → inherited from Aspose.Words.Node |
public Aspose.Words.CompositeNode getParentNode()
|
-
Gets the immediate parent of this node.
If a node has just been created and not yet added to the tree,
or if it has been removed from the tree, the parent is null.
getPlaceholder | |
public Aspose.Words.BuildingBlocks.BuildingBlock getPlaceholder()
|
-
Gets the Aspose.Words.BuildingBlocks.BuildingBlock containing placeholder text which should be displayed when this SDT run contents are empty,
the associated mapped XML element is empty as specified via the XmlMapping element
or the IsShowingPlaceholderText element is true.
Can be null, meaning that the placeholder is not applicable for this Sdt.
getPlaceholderName/setPlaceholderName | |
public java.lang.String getPlaceholderName() / public void setPlaceholderName(java.lang.String value)
|
Gets or sets Name of the Aspose.Words.BuildingBlocks.BuildingBlock containing placeholder text.
BuildingBlock with this name #Error Cref: P:Aspose.Words.BuildingBlocks.BuildingBlock.Name has to be present in the #Error Cref: P:Aspose.Words.Document.GlossaryDocument
otherwise System.InvalidOperationException will occur.
getPreviousSibling | → inherited from Aspose.Words.Node |
public Aspose.Words.Node getPreviousSibling()
|
-
Gets the node immediately preceding this node.
If there is no preceding node, a null is returned.
getRange | → inherited from Aspose.Words.Node |
public Aspose.Words.Range getRange()
|
-
Returns a Range object that represents the portion of a document that is contained in this node.
getSdtType | |
public int getSdtType()
|
-
Gets type of this Structured document tag.
The value of the property is SdtType integer constant.
getTag/setTag | |
public java.lang.String getTag() / public void setTag(java.lang.String value)
|
-
Specifies a tag associated with the current SDT node.
Can not be null.
A tag is an arbitrary string which applications can associate with SDT
in order to identify it without providing a visible friendly name.
getTitle/setTitle | |
public java.lang.String getTitle() / public void setTitle(java.lang.String value)
|
-
Specifies the friendly name associated with this SDT.
Can not be null.
-
Gets an object that represents the mapping of this structured document tag to XML data
in a custom XML part of the current document.
You can use the XmlMapping.setMapping(com.aspose.words.CustomXmlPart,java.lang.String,java.lang.String) method of this object to map
a structured document tag to XML data.
clear | |
public void clear()
throws java.lang.Exception |
-
Clears contents of this structured document tag and displays a placeholder if it is defined.
It is not possible to clear contents of a structured document tag if it has revisions.
If this structured document tag is mapped to custom XML (with using the XmlMapping
property), the referenced XML node is cleared.
dd | → inherited from Aspose.Words.CompositeNode |
public void dd() |
-
deepClone | → inherited from Aspose.Words.Node |
public Aspose.Words.Node deepClone(boolean isCloneChildren) |
-
Creates a duplicate of the node.
This method serves as a copy constructor for nodes.
The cloned node has no parent, but belongs to the same document as the original node.
This method always performs a deep copy of the node. The isCloneChildren parameter
specifies whether to perform copy all child nodes as well.
- Parameters:
isCloneChildren
- True to recursively clone the subtree under the specified node;
false to clone only the node itself.
- Returns:
- The cloned node.
getAncestor | → inherited from Aspose.Words.Node |
public Aspose.Words.CompositeNode getAncestor(java.lang.Class ancestorType) |
-
Gets the first ancestor of the specified object type.
The ancestor type matches if it is equal to ancestorType or derived from ancestorType.
- Parameters:
ancestorType
- The object type of the ancestor to retrieve.
- Returns:
- The ancestor of the specified type or null if no ancestor of this type was found.
getContainer | → inherited from Aspose.Words.CompositeNode |
public Aspose.Words.CompositeNode getContainer() |
- Reserved for internal use.
getDeleteRevision | |
public aspose.obfuscated.type getDeleteRevision() |
- Reserved for internal use.
getInsertRevision | |
public aspose.obfuscated.type getInsertRevision() |
- Reserved for internal use.
getLevel_IMarkupNode | |
public int getLevel_IMarkupNode() |
- Reserved for internal use.
getMoveFromRevision | |
public aspose.obfuscated.type getMoveFromRevision() |
- Reserved for internal use.
getMoveToRevision | |
public aspose.obfuscated.type getMoveToRevision() |
- Reserved for internal use.
getNextMatchingNode | → inherited from Aspose.Words.CompositeNode |
public Aspose.Words.Node getNextMatchingNode(aspose.obfuscated.type curNode) |
- Reserved for internal use.
getText | → inherited from Aspose.Words.CompositeNode |
public java.lang.String getText() |
-
Gets the text of this node and of all its children.
The returned string includes all control and special characters as described in Aspose.Words.ControlChar.
iterator | → inherited from Aspose.Words.CompositeNode |
public java.util.Iterator iterator() |
-
Provides support for the for each style iteration over the child nodes of this node.
remove | → inherited from Aspose.Words.Node |
public void remove() |
-
Removes itself from the parent.
removeAllChildren | → inherited from Aspose.Words.CompositeNode |
public void removeAllChildren() |
-
Removes all the child nodes of the current node.
removeSelfOnly | |
public void removeSelfOnly()
throws java.lang.Exception |
-
Removes just this SDT node itself, but keeps the content of it inside the document tree.
removeSmartTags | → inherited from Aspose.Words.CompositeNode |
public void removeSmartTags() |
-
Removes all SmartTag descendant nodes of the current node.
This method does not remove the content of the smart tags.
selectNodes | → inherited from Aspose.Words.CompositeNode |
public Aspose.Words.NodeList selectNodes(java.lang.String xpath) |
-
Selects a list of nodes matching the XPath expression.
Only expressions with element names are supported at the moment. Expressions
that use attribute names are not supported.
- Parameters:
xpath
- The XPath expression.
- Returns:
- A list of nodes matching the XPath query.
selectSingleNode | → inherited from Aspose.Words.CompositeNode |
public Aspose.Words.Node selectSingleNode(java.lang.String xpath) |
-
Selects the first Node that matches the XPath expression.
Only expressions with element names are supported at the moment. Expressions
that use attribute names are not supported.
- Parameters:
xpath
- The XPath expression.
- Returns:
- The first Node that matches the XPath query or null if no matching node is found.
setDeleteRevision | |
public void setDeleteRevision(aspose.obfuscated.type value) |
- Reserved for internal use.
setInsertRevision | |
public void setInsertRevision(aspose.obfuscated.type value) |
- Reserved for internal use.
setMoveFromRevision | |
public void setMoveFromRevision(aspose.obfuscated.type value) |
- Reserved for internal use.
setMoveToRevision | |
public void setMoveToRevision(aspose.obfuscated.type value) |
- Reserved for internal use.
toString | |
public java.lang.String toString() |
-
toString | → inherited from Aspose.Words.Node |
public java.lang.String toString(SaveOptions saveOptions)
throws java.lang.Exception |
-
Exports the content of the node into a string using the specified save options.
- Parameters:
saveOptions
- Specifies the options that control how the node is saved.
- Returns:
- The content of the node in the specified format.
toTxt | → inherited from Aspose.Words.Node |
public java.lang.String toTxt()
throws java.lang.Exception |
-
Exports the content of the node into a string in plain text format.
This method removes field codes and Microsoft Word control characters, uses CrLf
(or any other) combination of characters to mark ends of paragraphs in the resulting string.
It produces a different result from #Error Cref: M:Aspose.Words.Node.GetText which just gets the text from
the node without removing field codes or special characters.
- Returns:
- The content of the node in plain text format.
- See Also:
- TxtSaveOptions.ParagraphBreak, TxtSaveOptions.ExportHeadersFooters
See Also:
Aspose.Words Documentation - the home page for the Aspose.Words Product Documentation.
Aspose.Words Support Forum - our preferred method of support.