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

Adjust range for DTD Validation errors #107

Closed
angelozerr opened this issue Sep 8, 2018 · 14 comments
Closed

Adjust range for DTD Validation errors #107

angelozerr opened this issue Sep 8, 2018 · 14 comments
Assignees
Labels
DTD enhancement New feature or request validation
Milestone

Comments

@angelozerr
Copy link
Contributor

No description provided.

@angelozerr
Copy link
Contributor Author

@NikolasKomonen I have adjusted error for DTD like WTP XMl Editor, but it misses tests. It should be cool if you could write it for each DTD error code in the existing DTDDiagnosticsTest class. Thanks!

@fbricon fbricon added enhancement New feature or request validation labels Sep 12, 2018
@fbricon fbricon added the to do label Sep 25, 2018
@fbricon
Copy link
Contributor

fbricon commented Nov 13, 2018

Error ranges are still wrong:

screen shot 2018-11-13 at 12 40 05 pm

@fbricon fbricon added the DTD label Nov 13, 2018
@angelozerr
Copy link
Contributor Author

Could you attach your XML content in this issue please.

@fbricon
Copy link
Contributor

fbricon commented Nov 13, 2018

<?xml version="1.0"?>
<!DOCTYPE note [
<!ELEMENT note (to,from,heading,body)>
    <!ELEMENT to (#PCDATA)>
        <!ELEMENT from (#PCDATA)>
                <!ELEMENT heading (#PCDATA)>
            <!ELEMENT body (#PCDATA)>
]>
<note>
    <from>Jani</from>
    <heading>Reminder</heading>
    <body>Don't forget me this weekend</body>
</note>

@angelozerr
Copy link
Contributor Author

@fbricon should be fixed and with test too:)

@fbricon
Copy link
Contributor

fbricon commented Nov 13, 2018

Yup it works.

Now we just need tests for MSG_CONTENT_INCOMPLETE, MSG_REQUIRED_ATTRIBUTE_NOT_SPECIFIED, MSG_ATTRIBUTE_NOT_DECLARED, MSG_ATTRIBUTE_VALUE_NOT_IN_LIST so we can close that one

@angelozerr
Copy link
Contributor Author

yes sure, if you can write it or just find sample like you have done previously, it should be very cool.

@fbricon
Copy link
Contributor

fbricon commented Nov 13, 2018

There's 3:

<?xml version="1.0"?>
<!DOCTYPE note [
<!ELEMENT note (to,from,heading,body)>
<!ELEMENT to (#PCDATA)>
<!ELEMENT from (#PCDATA)>
<!ELEMENT heading (#PCDATA)>
<!ELEMENT body (#PCDATA)>
]>
<note>
    <foo></foo>
    <from nope="">Jani</from>
    <heading>Reminder</heading>
    <body>Don't forget me this weekend</body>
</note>

screen shot 2018-11-13 at 1 22 01 pm

@fbricon
Copy link
Contributor

fbricon commented Nov 13, 2018

Another issue (found while checking https://www.tutorialspoint.com/dtd/dtd_attributes.htm examples):

<?xml version = "1.0"?>
<!DOCTYPE address [
  <!ELEMENT address (company)*>
  <!ELEMENT company (#PCDATA)>
  <!ATTLIST company name NMTOKEN #FIXED "tutorialspoint">
]>
<address>
  <company name="etutorialspoint">we are a free online teaching faculty</company>
</address>

screen shot 2018-11-13 at 1 37 44 pm

@fbricon
Copy link
Contributor

fbricon commented Nov 13, 2018

<?xml version = "1.0"?>
<!DOCTYPE foo [
  <!ELEMENT foo (bar)*>
  <!ELEMENT bar (#PCDATA)>
  <!ATTLIST bar fruit (one | two | three) #REQUIRED>
]>
<foo>
    <bar fruit="four">toto</bar>
</foo>

screen shot 2018-11-13 at 1 52 30 pm

Feels like we'll still need to cover a ton of other errors, not listed in DTDErrorCode.java

@angelozerr
Copy link
Contributor Author

Another issue (found while checking https://www.tutorialspoint.com/dtd/dtd_attributes.htm examples):

WTP don't support it. lsp4xml supports it now.

Now we just need tests for MSG_CONTENT_INCOMPLETE, MSG_REQUIRED_ATTRIBUTE_NOT_SPECIFIED, MSG_ATTRIBUTE_NOT_DECLARED, MSG_ATTRIBUTE_VALUE_NOT_IN_LIST so we can close that one

Done.

@fbricon please close this issue if you think it's good and you find not another error whihc could be not supported. Thanks!

@angelozerr angelozerr added this to the v0.0.3 milestone Nov 14, 2018
@fbricon
Copy link
Contributor

fbricon commented Nov 15, 2018

Found a couple other errors:

  • missing closing bracket:
<?xml version="1.0"?>
<!DOCTYPE note [
<!ELEMENT note (to,from,heading,body)>
<!ELEMENT to (#PCDATA)
<!ELEMENT from (#PCDATA)>
<!ELEMENT heading (#PCDATA)>
<!ELEMENT body (#PCDATA)>
]>
<note>
	<to>dd</to>
    <from>Jani</from>
    <heading>Reminder</heading>
    <body>Don't forget me this weekend</body>
</note>

screen shot 2018-11-15 at 1 25 17 pm

  • invalid type
<?xml version="1.0"?>
<!DOCTYPE note [
<!ELEMENT note (to,from,heading,body)>
<!ELEMENT to (#PCDATA)>
<!ELEMENT from (#PCDATA)>
<!ELEMENT heading (#PCDATA)>
<!ELEMENT body (#PCDAxTA)>
]>
<note>
	<to>dd</to>
    <from>Jani</from>
    <heading>Reminder</heading>
    <body>Don't forget me this weekend</body>
</note>

screen shot 2018-11-15 at 1 24 56 pm

@angelozerr
Copy link
Contributor Author

@fbricon thoses errors are for DTD content. I need parser

@fbricon fbricon changed the title Adjust range for DTD errors Adjust range for DTD Validation errors Nov 15, 2018
@fbricon
Copy link
Contributor

fbricon commented Nov 15, 2018

Fair enough. Closing.

@fbricon fbricon closed this as completed Nov 15, 2018
@fbricon fbricon removed the to do label Nov 15, 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 validation
Projects
None yet
Development

No branches or pull requests

3 participants