Skip to content
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

XMLDocument must support parsing of DTD elements, attributes, entities #231

Closed
angelozerr opened this issue Nov 15, 2018 · 3 comments
Closed
Assignees
Labels
DTD enhancement New feature or request in progress
Milestone

Comments

@angelozerr
Copy link
Contributor

angelozerr commented Nov 15, 2018

This issue is very important of we wish to support DTD (I mean not validation, completion based on DTD inside XML, but I mean DTD content):

@NikolasKomonen do you know when you could provide a PR for this issue? I need it for adjust DTD error. Thanks!

@angelozerr angelozerr added the DTD label Nov 15, 2018
@fbricon fbricon added the enhancement New feature or request label Nov 15, 2018
@fbricon fbricon added this to the v0.0.3 milestone Nov 15, 2018
@angelozerr
Copy link
Contributor Author

@NikolasKomonen for your work with DTD parser, I suggest you read https://www.w3.org/TR/REC-xml/#dt-doctype to use the well name.

For instance you have defined a custom DocumentType#getInternalDTD but it's the same thing than org.w3c.dom.DocumentType#getInternalSubset().

Other idea is prefering to store start/end offset instead of storing the string in the DocumentType. You can see a sample with DocumentType#getContent. It gives you 2 benefits:

  • you have location offset of content. So for instance for systemId, it's better to have start/end offset of systemId which will gives the capability to manage completion for DTD files, hyperlink, etc. You have a sample in NoNamespaceSchemaLocation. Instead of storing the "xsi:noNamespaceShcemaLocation" attribute value, I store the attribute (in other words the start/end offset of the attribute value) and after I can manage hyperlink (see ContentModelDocumentLinkParticipant)

  • it avoids to call substring (from start/end offset retrieved by the scanner) to get the text although you don't need the string value. The string value must b egetted only if you need it (ex: if user do an hyperlink).

Hope you will understand what I mean.

@angelozerr
Copy link
Contributor Author

@NikolasKomonen pay attention I have done a big refactoring to rename DOM structures (ex: Attr to DOMAttr). I have done that since suggestion of sonar.

@angelozerr
Copy link
Contributor Author

Scanner and parser supports now DTD tolerant parsing. I close this issue. If you find bugs, please create a new issue.

@angelozerr angelozerr reopened this Dec 10, 2018
NikolasKomonen added a commit to NikolasKomonen/lsp4xml that referenced this issue Dec 14, 2018
NikolasKomonen added a commit to NikolasKomonen/lsp4xml that referenced this issue Dec 14, 2018
NikolasKomonen added a commit to NikolasKomonen/lsp4xml that referenced this issue Dec 17, 2018
NikolasKomonen added a commit to NikolasKomonen/lsp4xml that referenced this issue Dec 18, 2018
NikolasKomonen added a commit to NikolasKomonen/lsp4xml that referenced this issue Dec 18, 2018
NikolasKomonen added a commit to NikolasKomonen/lsp4xml that referenced this issue Dec 19, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
DTD enhancement New feature or request in progress
Projects
None yet
Development

No branches or pull requests

3 participants