Add direct Custom XML Parts API support to ONLYOFFICE Spreadsheet Editor (XLSX)

Topic: Proposing a feature enhancement for the ONLYOFFICE Spreadsheet (XLSX) API.

Goal: To enable read and write operations on Custom XML Parts within .xlsx files directly through the frontend API (via Macros and Plugins).


Current Status (现状描述)

We know that the Text Document (DOCX) API offers robust support for Custom XML Parts through classes like ApiCustomXmlParts and methods like GetXml(), UpdateAttribute(), etc. This functionality is crucial for data binding and metadata management in Word documents.

However, the Spreadsheet (XLSX) API currently appears to lack equivalent methods for direct Custom XML Part manipulation.

Specific Requirement (具体需求)

We request that the Document Server enhance the Spreadsheet API to include similar functionality. For instance, adding methods like:

  • ApiWorksheet.GetCustomXmlParts() or a document-level Api.GetCustomXmlParts().

This would enable us to implement the following features within our frontend plugins:

  1. Reading existing Custom XML Parts from the loaded .xlsx file.
  2. Real-time updating or creation of new Custom XML data.
  3. Direct manipulation of the XML structure using XPath or similar methods.

Business Value (业务价值)

This feature is critical for enterprise use cases that require embedding business metadata or advanced configurations directly into the spreadsheet file. Examples include:

  • Reporting Systems: Storing report configurations, filters, or version control data as embedded XML.
  • Data Templates: Using .xlsx files as templates where complex data mappings are stored in custom XML.

The current limitation forces us to rely on the Document Builder or external back-end tools for file modification. This results in complex, asynchronous workflows that break the real-time interaction and preview capabilities of frontend plugins.

Conclusion and Expectation (总结/期待)

We strongly encourage the ONLYOFFICE team to consider adding this functionality in a future release. Implementing this feature would significantly enhance the flexibility and power of ONLYOFFICE in various enterprise data integration and template automation scenarios.

Hello @weekhy

Thank you for the suggestion. We need some time to analyze it, please await my feedback.

UPD: The suggestion has been registered. Thank you for the interest.