---
Product: Aspose.Cells
Platform: python
Page Type: reference
Canonical URL: https://reference.aspose.org/cells/python/commentxmlwriter
---

# CommentXMLWriter

## Overview

`CommentXMLWriter` is a class in Aspose.Cells FOSS for Python.

Handles writing comment data to XML format.

This class declares 6 methods for CommentXMLWriter objects in Python programs.
Available methods include: `__init__`, `cell_reference_sort_key`, `escape_xml`, `worksheet_has_comments`, `write_comments_xml`, `write_vml_drawing_xml`.
Public members are accessible to any Python application after installing the Aspose.Cells FOSS for Python package.

## Methods

| Signature | Description |
|-----------|-------------|
| `__init__()` | Initialize the CommentXMLWriter. |
| `escape_xml(text)` | Escapes special XML characters in text. |
| `worksheet_has_comments(worksheet)` | Checks if a worksheet has any comments. |
| `cell_reference_sort_key(ref)` | Converts a cell reference to a (row, col) tuple for sorting. |
| `write_comments_xml(zipf, worksheet, sheet_num)` | Writes xl/comments{sheet_num}.xml file for a worksheet. |
| `write_vml_drawing_xml(zipf, worksheet, sheet_num)` | Writes VML drawing XML for comment positioning. |

## See Also

- [Aspose.Cells for Python — Enterprise API Reference](https://reference.aspose.com/cells/python-java/)