Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Capture more of the Document #668

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
dubinsky merged 1 commit into scala:main from dubinsky:more-document-information
Jun 21, 2023
Merged

Capture more of the Document #668

dubinsky merged 1 commit into scala:main from dubinsky:more-document-information
Jun 21, 2023

Conversation

Copy link
Contributor

@dubinsky dubinsky commented Jun 8, 2023
edited
Loading

  • handle Locator2, DTDHandler, DeclHandler, and LexicalHandler DTD and entity methods;
  • introduce DtdBuilder and delegate DTD methods to it;
  • introduce ElementContentModel and delegate parsing of the element content model in the DTD element declarations to it;
  • XMLLoader.loadDocument() returns baseURI, XML version, encoding and standAlone flag, and DTD;
  • tests demonstrating the new returns.

Now that XMLoader returns Document, there is a place to return more information abut the parsed XML document - and this change does that, bringing XMLLoader to parity with the ConstructingParser ; returned now are:

  • document's baseURI (which ConstructingParser never returned and indeed couldn't return);
  • XML version of the document (which ConstructingParser returns correctly only if it is "1.0");
  • standalone status of the document;
  • document's encoding (ConstructingParser seems unable to parse documents encoded in UTF-16);
  • document's DTD (ConstructingParser does not return element and attribute declarations, notations and some entities).

To preserve binary compatibility, parsed DTD is converted (with some loss of fidelity) into pre-existing ContentModel classes, instead of replacing them with the newly-introduced ElementContentModel.
To avoid capturing by the binary compatibility rules, newly introduced classes are package-private.

Copy link
Member

no objection here — feel free to merge if no other reviewers appear

Copy link
Contributor Author

feel free to merge if no other reviewers appear

Thank you!

- handle Locator2, DTDHandler, DeclHandler, and LexicalHandler DTD and entity methods;
- introduce DtdBuilder and delegate DTD methods to it;
- introduce ElementContentModel and delegate parsing of the element content model in the DTD element declarations to it;
- XMLLoader.loadDocument() returns baseURI, XML version, encoding and standAlone flag and DTD;
- tests demonstrating the new returns;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Reviewers

@SethTisue SethTisue Awaiting requested review from SethTisue

@ashawley ashawley Awaiting requested review from ashawley

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

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