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

Document limitation with comment in DTD #72

Merged
merged 1 commit into from
Dec 18, 2018

Conversation

m-g-sonar
Copy link

@m-g-sonar m-g-sonar commented Dec 17, 2018

Relates to https://jira.sonarsource.com/browse/SONARXML-73
Reported in Woodstox repository: FasterXML/woodstox#67

@@ -192,9 +192,13 @@ private void finalizePreviousNode(XmlFilePosition endLocation) {
private XMLStreamReader getXmlStreamReader() throws XMLStreamException {
Reader reader = new StringReader(content);

XMLInputFactory factory = XMLInputFactory.newInstance();
// forcing the XMLInputFactory implementation class, in order to be sure that we are going to us the adequate
Copy link
Contributor

Choose a reason for hiding this comment

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

use

DocumentType documentType = (DocumentType) document.getFirstChild();
assertRange(documentType, Location.NODE, 2, 0, 7, 2);
Node lastChild = document.getLastChild();
// location of the node is wrong, should be line 8, event are not at the correct place
Copy link
Contributor

Choose a reason for hiding this comment

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

events

"<!ELEMENT menu (modulo)* >\n" +
"]>\n" +
"<menu value=\"foo\"></menu>").getDocument();
assertThat(document.getChildNodes().getLength()).isEqualTo(2);
Copy link
Contributor

Choose a reason for hiding this comment

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

something is wrong with indentation

@m-g-sonar m-g-sonar merged commit 80ef751 into master Dec 18, 2018
@m-g-sonar m-g-sonar deleted the document_dtd_wrong_location branch December 18, 2018 09:12
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.

3 participants