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

DTD validation not working #42

Closed
Tyk opened this issue Apr 27, 2020 · 17 comments
Closed

DTD validation not working #42

Tyk opened this issue Apr 27, 2020 · 17 comments

Comments

@Tyk
Copy link

Tyk commented Apr 27, 2020

I am using the XMLTools to validate some of my older XML's. In the latest releases > 3.0.3.3 the DTD validation is not working any more is there a way to get the DTD validation working again.

@morbac
Copy link
Owner

morbac commented Apr 27, 2020

Hi, have you tried disabling "Prohibit DTD" feature in XMLTools Options dialog ?
By default, MSXML 6 disables DTD support due to security purposes (details here).

@Tyk
Copy link
Author

Tyk commented Apr 27, 2020

Hi,
yes I tried but id does not help. I also did a compare with an older relase and saw a piece of code is missing in the XMLValidation function.

Thank you,

image

@Tyk
Copy link
Author

Tyk commented Apr 27, 2020

OK, I understand now.
but the prohibit is default. Maybe the option should enable the DTD as it is prohibited by default.

This is the error I get trying to use the Prohibit DTD flag.
image

Thank you

@morbac
Copy link
Owner

morbac commented Apr 29, 2020

Hi, I come back on initial post.
Please can you either give more informations on the issue or provide an example ?
You mention "DTD validation is not working any more", but it would help if you explain what is wrong (error message, wrong behaviour, etc.)

I tried validating xml with DTD using both syntax:
<!DOCTYPE catalog SYSTEM "books.dtd">
<!DOCTYPE catalog PUBLIC "-//OASIS//DTD TEST Composite//EN" "books.dtd">
and both worked as expected.

Thanks

@Tyk
Copy link
Author

Tyk commented Apr 29, 2020

Hi,
I have a file which has a DTD like your and when I click validate it shows the dialog to insert XSD schema. I tried to paste the path to the DTD file but it is not solving the problem. I verified the path of the DTD and it is OK, but the are not local like yours (are in a different folder)

Thank you

@morbac
Copy link
Owner

morbac commented Apr 29, 2020

Very strange.
Can you tri with latest version available here: https://github.com/morbac/xmltools/releases/tag/3.0.4.3
Thks

@Tyk
Copy link
Author

Tyk commented May 5, 2020

Hi,

I have tried the new version and the issue is still the same. I have also tried to use an older version
image

Which works fine with the same file.

@plutonn
Copy link

plutonn commented May 18, 2020

Indeed, something is wrong in the validation, I have tried the latest version indicated in this thread and I do not see that it improves.
The question is:
-If I want to validate an xml with external dtd without Xsd shema, it asks for the XSD, then ... it is not validating the dtd.

Previously it offered a window reporting "DTD validation: XML is valid" now only "No error detected", as if it was just performing a syntax check.

The errors found in the validation of an xsd, previously showed them in a list, all. Now, only the first one you find in red on the code, until it is not solved you do not know the next. I think the error summary is very interesting.

Conclusion:
By not indicating "valid" you are left with the doubt if you have validated it.

I edit:

I have been testing versions, in 2.4.11.0 everything is validated perfectly and shows the correct message.

@jotjotmark
Copy link

The same problem as above. Pair of xml and xsd files, Win 10 2004, NPP 7.8.7 32 bit. The old validator 2.3.2 and the freeformatter on-line validator works well while 3.0.4.2 shows the message "Invalid schema or missing namespace"

@jotjotmark
Copy link

After changing to version 3.0.4.3 another message is displayed. Translation from Polish: The node is not valid or invalid - no DTD schema declaration or definition was found

@LetMeSleepAlready
Copy link
Collaborator

I just tried this on the books-well-formed.xml example.

image

This happens -before- the schema popup. So, when the schema-popup opens, that means that the XML / DTD validation has already passed. Yeah, that is a bit nasty....

However, for this to work, I had to disable "prohibit DTD" and enable "resolve externals", otherwise I got the following error:

image

After tweaking these 2 settings, and if you still have the same errors.. would it be possible to share the XML / DTD files (or a small subset of them)?

@jotjotmark
Copy link

Tweaking these 2 settings has helped! Thank you.

@yddtime
Copy link

yddtime commented Oct 9, 2020

Hi,

I'm on 3.1 and have "prohibit DTD" = false and "resolve externals" = true but I'm still being prompted for a XSD file and namespace URI when trying to validate XML with a DTD file.

Any suggestions?

Thanks.

@morbac
Copy link
Owner

morbac commented Oct 15, 2020

Hi, a fix has been done in 3.1.0.1
Please can you test if it's ok ?
Thanks

@yddtime
Copy link

yddtime commented Oct 21, 2020

Hi morbac,
3.1.01 fixes the problem. Thanks for the prompt response.

@RGShepherd
Copy link

On the other hand, I'm hitting this same problem (I have "prohibit DTD" = false and "resolve externals" = true but I'm still being prompted for a XSD file and namespace URI when trying to validate XML with a DTD file) in 3.1.1.10. Any suggestions?

Thanks!

@ChrisDWhitehead
Copy link

ChrisDWhitehead commented Sep 26, 2022

Still having the same problem at 3.1.1.15 where the validator will parse the XML , but then ignore the external DTD. Does work if the DTD is internal/inline, but not if it's external. Always insists on setting up an XML Schema instead. The XML parser actually checks for the presence of the dtd file, but then the validator just doesn't use it.

I've found out that if I click OK through the XML Schema dialog (without entering anything) the validator does use the DTD.

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

No branches or pull requests

8 participants