Skip to content

UPSTREAM PR #17479: Fix DTD error message to suggest correct syntax#43

Open
loci-dev wants to merge 1 commit intomainfrom
loci/pr-17479-fix-dtd-error-message
Open

UPSTREAM PR #17479: Fix DTD error message to suggest correct syntax#43
loci-dev wants to merge 1 commit intomainfrom
loci/pr-17479-fix-dtd-error-message

Conversation

@loci-dev
Copy link

@loci-dev loci-dev commented Feb 3, 2026

Note

Source pull request: nushell/nushell#17479

Description

Fixes #17145

When opening an XML file with a DTD declaration, the error message previously suggested using --allow-dtd flag on the open command. However, this flag only exists on the from xml command.

Changes

  • Modified open command error handling to detect DTD-related XML parsing errors
  • Updated the error message to suggest the correct command syntax: open --raw 'file.xml' | from xml --allow-dtd

Before

Error: DTD processing is disabled. Add --allow-dtd to your command.

After

Error: DTD processing is disabled. Use: open --raw 'file.xml' | from xml --allow-dtd

User-Facing Changes

Error messages for XML files with DTDs now provide correct instructions on how to parse them.

Tests + Formatting

  • Verified the fix works by testing with XML files containing DTD declarations
  • Ran cargo fmt and cargo clippy

Fixes issue #17145 where the error message for XML files with DTDs
suggested using --allow-dtd flag on the open command, but this flag
only exists on the 'from xml' command.

The fix detects DTD-related XML parsing errors and provides the
correct suggestion: 'open --raw file.xml | from xml --allow-dtd'

Changes:
- Modified open command error handling to detect DTD errors
- Updated help message to suggest the correct command syntax
- Added test to verify the fix works correctly
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants