word_open_xml_minimal property

StructuredDocumentTagRangeStart.word_open_xml_minimal property

Gets a string that represents the XML contained within the node in the SaveFormat.FLAT_OPC format.

Unlike the StructuredDocumentTagRangeStart.word_open_xml property, this method generates a stripped-down document that excludes any non-content-related parts.

@property
def word_open_xml_minimal(self) -> str:
    ...

Examples

Shows how to get minimal XML contained within the node in the FlatOpc format.

doc = aw.Document(file_name=MY_DIR + 'Multi-section structured document tags.docx')
tag = doc.get_child(aw.NodeType.STRUCTURED_DOCUMENT_TAG_RANGE_START, 0, True).as_structured_document_tag_range_start()
self.assertTrue('<pkg:part pkg:name="/docProps/app.xml" pkg:contentType="application/vnd.openxmlformats-officedocument.extended-properties+xml">' in tag.word_open_xml_minimal)
self.assertFalse('xmlns:w16cid="http://schemas.microsoft.com/office/word/2016/wordml/cid"' in tag.word_open_xml_minimal)

See Also