data_checksum property

CustomXmlPart.data_checksum property

Specifies a cyclic redundancy check (CRC) checksum of the CustomXmlPart.data content.

@property
def data_checksum(self) -> int:
    ...

Examples

Shows how the checksum is calculated in a runtime.

doc = aw.Document()
rich_text = aw.markup.StructuredDocumentTag(doc, aw.markup.SdtType.RICH_TEXT, aw.markup.MarkupLevel.BLOCK)
doc.first_section.body.append_child(rich_text)
# The checksum is read-only and computed using the data of the corresponding custom XML data part.
rich_text.xml_mapping.set_mapping(doc.custom_xml_parts.add(str(uuid.uuid4()), '<root><text>ContentControl</text></root>'), '/root/text', '')
checksum = rich_text.xml_mapping.custom_xml_part.data_checksum
print(checksum)
rich_text.xml_mapping.set_mapping(doc.custom_xml_parts.add(str(uuid.uuid4()), '<root><text>Updated ContentControl</text></root>'), '/root/text', '')
updated_checksum = rich_text.xml_mapping.custom_xml_part.data_checksum
print(updated_checksum)
# We changed the XmlPart of the tag, and the checksum was updated at runtime.
self.assertNotEqual(checksum, updated_checksum)

See Also