StructuredDocumentTagRangeStart class
StructuredDocumentTagRangeStart class
Represents a start of ranged structured document tag which accepts multi-sections content. See also StructuredDocumentTagRangeEnd. To learn more, visit the Structured Document Tags or Content Control documentation article.
Remarks
Can be immediate child of Body node only.
Inheritance: StructuredDocumentTagRangeStart → Node
Interfaces: IStructuredDocumentTag
Constructors
Name | Description |
---|---|
StructuredDocumentTagRangeStart(doc, type) | Initializes a new instance of the Structured document tag range start class. |
Properties
Name | Description |
---|---|
appearance | Gets or sets the appearance of the structured document tag. |
color | Gets or sets the color of the structured document tag. |
custom_node_id | Specifies custom node identifier. (Inherited from Node) |
document | Gets the document to which this node belongs. (Inherited from Node) |
id | Specifies a unique read-only persistent numerical Id for this structured document tag. |
is_composite | Returns True if this node can contain other nodes.(Inherited from Node) |
is_multi_section | Returns true if this instance is a ranged (multi-section) structured document tag. (Inherited from IStructuredDocumentTag) |
is_showing_placeholder_text | Specifies whether the content of this structured document tag shall be interpreted to contain placeholder text (as opposed to regular text contents within the structured document tag). |
last_child | Gets the last child in the stdContent range. |
level | Gets the level at which this structured document tag range start occurs in the document tree. |
lock_content_control | When set to True , this property will prohibit a user from deleting this structured document tag. |
lock_contents | When set to True , this property will prohibit a user from editing the contents of this structured document tag. |
next_sibling | Gets the node immediately following this node. (Inherited from Node) |
node | Returns Node object that implements this interface. (Inherited from IStructuredDocumentTag) |
node_type | Returns NodeType.STRUCTURED_DOCUMENT_TAG_RANGE_START. |
parent_node | Gets the immediate parent of this node. (Inherited from Node) |
placeholder | Gets the BuildingBlock containing placeholder text which should be displayed when this structured document tag run contents are empty, the associated mapped XML element is empty as specified via the StructuredDocumentTagRangeStart.xml_mapping element or the StructuredDocumentTagRangeStart.is_showing_placeholder_text element is True . |
placeholder_name | Gets or sets Name of the BuildingBlock containing placeholder text. |
previous_sibling | Gets the node immediately preceding this node. (Inherited from Node) |
range | Returns a Range object that represents the portion of a document that is contained in this node. (Inherited from Node) |
range_end | Specifies end of range if the StructuredDocumentTag is a ranged structured document tag. Otherwise returns None . |
sdt_type | Gets type of this structured document tag. |
tag | Specifies a tag associated with the current structured document tag node. Can not be None . |
title | Specifies the friendly name associated with this structured document tag. Can not be None . |
word_open_xml | Gets a string that represents the XML contained within the node in the SaveFormat.FLAT_OPC format. |
word_open_xml_minimal | Gets a string that represents the XML contained within the node in the SaveFormat.FLAT_OPC format. |
xml_mapping | Gets an object that represents the mapping of this structured document tag range to XML data in a custom XML part of the current document. |
Methods
Name | Description |
---|---|
accept(visitor) | Accepts a visitor. |
append_child(new_child) | Adds the specified node to the end of the stdContent range. |
clone(is_clone_children) | Creates a duplicate of the node. (Inherited from Node) |
get_ancestor(ancestor_type) | Gets the first ancestor of the specified object type. (Inherited from Node) |
get_ancestor(ancestor_type) | Gets the first ancestor of the specified NodeType. (Inherited from Node) |
get_child_nodes(node_type, is_deep) | Returns a live collection of child nodes that match the specified types. |
get_text() | Gets the text of this node and of all its children. (Inherited from Node) |
next_pre_order(root_node) | Gets next node according to the pre-order tree traversal algorithm. (Inherited from Node) |
node_type_to_string(node_type) | A utility method that converts a node type enum value into a user friendly string. (Inherited from Node) |
previous_pre_order(root_node) | Gets the previous node according to the pre-order tree traversal algorithm. (Inherited from Node) |
remove() | Removes itself from the parent. (Inherited from Node) |
remove_all_children() | Removes all the nodes between this range start node and the range end node. |
remove_self_only() | Removes this range start and appropriate range end nodes of the structured document tag, but keeps its content inside the document tree. |
to_string(save_format) | Exports the content of the node into a string in the specified format. (Inherited from Node) |
to_string(save_options) | Exports the content of the node into a string using the specified save options. (Inherited from Node) |
Examples
Shows how to get the properties of multi-section structured document tags.
doc = aw.Document(file_name=MY_DIR + 'Multi-section structured document tags.docx')
range_start_tag = doc.get_child_nodes(aw.NodeType.STRUCTURED_DOCUMENT_TAG_RANGE_START, True)[0].as_structured_document_tag_range_start()
range_end_tag = doc.get_child_nodes(aw.NodeType.STRUCTURED_DOCUMENT_TAG_RANGE_END, True)[0].as_structured_document_tag_range_end()
print('StructuredDocumentTagRangeStart values:')
print(f'\t|Id: {range_start_tag.id}')
print(f'\t|Title: {range_start_tag.title}')
print(f'\t|PlaceholderName: {range_start_tag.placeholder_name}')
print(f'\t|IsShowingPlaceholderText: {range_start_tag.is_showing_placeholder_text}')
print(f'\t|LockContentControl: {range_start_tag.lock_content_control}')
print(f'\t|LockContents: {range_start_tag.lock_contents}')
print(f'\t|Level: {range_start_tag.level}')
print(f'\t|NodeType: {range_start_tag.node_type}')
print(f'\t|RangeEnd: {range_start_tag.range_end}')
print(f'\t|Color: {range_start_tag.color.to_argb()}')
print(f'\t|SdtType: {range_start_tag.sdt_type}')
print(f'\t|FlatOpcContent: {range_start_tag.word_open_xml}')
print(f'\t|Tag: {range_start_tag.tag}\n')
print('StructuredDocumentTagRangeEnd values:')
print(f'\t|Id: {range_end_tag.id}')
print(f'\t|NodeType: {range_end_tag.node_type}')
See Also
- module aspose.words.markup
- class Node
- class IStructuredDocumentTag