Skip to content

Navigation Menu

Sign in
Sign up

Initialize the document locator before starting tokenization - #124

Merged
sideshowbarker merged 1 commit into
master from
fix-null-document-system-id
Jul 31, 2026
Merged

Initialize the document locator before starting tokenization #124
sideshowbarker merged 1 commit into
master from
fix-null-document-system-id

Conversation

@sideshowbarker

@sideshowbarker sideshowbarker commented Jul 19, 2026
edited
Loading

Copy link
Copy Markdown
Member

Problem: When a caller supplies its own ContentHandler, the Document system identifier is null.

Cause: tokenizer.initLocation() wasn’t getting called until after Driver.tokenize() called tokenizer.start(). So the tokenizer’s systemId/publicId were still null when start() delivered the first SAX events.

Fix: Call initLocation() before start(). The locator carries the input source’s public/system IDs before any downstream handler observes it. Fixes #123.

@hsivonen hsivonen left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

Problem: When a caller supplies its own ContentHandler, the Document
system identifier is null.
Cause: tokenizer.initLocation() wasn’t getting called until after
Driver.tokenize() called tokenizer.start(). So the tokenizer’s systemId/
publicId were still null when start() delivered the first SAX events.
Fix: Call initLocation() before start(). The locator carries the input
source’s public/system IDs before any downstream handler observes it.
Fixes #123 
sideshowbarker merged commit 41e32be into master Jul 31, 2026
12 checks passed
sideshowbarker deleted the fix-null-document-system-id branch July 31, 2026 14:36

ndw commented Jul 31, 2026

Copy link
Copy Markdown

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@hsivonen hsivonen hsivonen approved these changes

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

The Document system identifier is null if you provide your own content handler.

AltStyle によって変換されたページ (->オリジナル) /