Skip to content

Adopt upstream PR #2973: Fix dynamicFilter parsing in tables #20

@protobi-pieter

Description

@protobi-pieter

Summary

Adopt upstream PR exceljs#2973 to fix parsing error when loading Excel files with dynamic filters in tables.

Currently, ExcelJS throws "Unexpected xml node in parseOpen" exception when encountering <dynamicFilter> nodes in table definitions. This fix prevents the exception by ignoring these unsupported nodes during parsing.

Upstream PR

Changes

File modified:

  • lib/xlsx/xform/table/filter-column-xform.js - Handle dynamicFilter nodes (3 lines)

Total: 3 additions, 0 deletions

Bug Description

When reading Excel files that contain tables with dynamic filters (e.g., date filters, top 10 filters), ExcelJS throws an exception and fails to load the file.

Current behavior:

  • Throws "Unexpected xml node in parseOpen" when encountering <dynamicFilter> nodes
  • Fails to load Excel files with dynamic table filters

Fixed behavior:

  • Silently ignores <dynamicFilter> nodes during parsing
  • Successfully loads Excel files with dynamic filters
  • No attempt to preserve or recreate dynamic filters (just prevents crashes)

Value Proposition

  • Low Risk - Simple 3-line addition to handle unsupported node type
  • Bug Fix - Prevents crashes when reading certain Excel files
  • Robustness - Improves compatibility with Excel files created by other tools

Testing Plan

  • Apply changes from upstream PR
  • Run existing test suite
  • Verify files with dynamic filters load without errors

Implementation Notes

This PR doesn't add full dynamic filter support - it only prevents the exception. Dynamic filters will be ignored when reading and won't be preserved when writing.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions