eerohele / exalt

A Sublime Text plugin for validating and formatting XML documents
MIT License
22 stars 3 forks source link

External DTD Validation not working #8

Closed vaibhav-bansal closed 7 years ago

vaibhav-bansal commented 7 years ago

Exalt doesn't detect the external DTD file or maybe it detects but can't read the definitions in the file when I select Validate Document. It works perfectly with Internal DTD and XSD files. And thank you for making this plugin. Really made my work easy.

1. Summary

Doesn't read the DTD definitions in the external DTD file.

2. Expected Behavior

Should notify "Valid markup".

3. Actual Behavior

Didn't read the definitions and notified "No declarations for element bookDB".

4. Code Used

XML File- bookDB.xml

<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE bookDB SYSTEM "bookDB.dtd">

<bookDB>
    <book>
        <name>Five Point Someone</name>
        <author>Chetan Bhagat</author>
    </book>
    <book>
        <name>I Too Had A Love Story!</name>
        <author>Ravindra Singh</author>
    </book>
    <book>
        <name>Goosebumps - The Werewolf of Fever Swamp</name>
        <author>R. L. Stine</author>
    </book>
</bookDB>

DTD File- bookDB.dtd

<!ELEMENT bookDB (book+)>
<!ELEMENT book (name,author)>
<!ELEMENT name (CDATA)>
<!ELEMENT author (CDATA)>

5. Environment

Operating System: Windows 8.1 x64 EN
Sublime Text: Build 3126

Thanks.

eerohele commented 7 years ago

Glad to hear you find it useful!

Yeah, Exalt doesn't support SYSTEM identifiers at the moment. I'll see what I can do about that.

eerohele commented 7 years ago

@vaibhav-bansal: v0.3.2 should fix the issue. Can you try updating the plugin, restarting Sublime Text, and checking whether the issue is fixed for you?

vaibhav-bansal commented 7 years ago

Thanks for the update and yes, it worked. I checked it with the same code I posted above. Now, it's detecting the external DTD and validating it correctly. But, there's an issue. When I change the definitions in the DTD file, it is not able to validate it right away. I have to restart Sublime to validate the changes. Thanks.

eerohele commented 7 years ago

By default, Exalt caches the schema for a document for performance reasons.

You should be able to run the "Exalt: Clear Parser Cache" command after updating the DTD instead of restarting Sublime Text. Please let me know if that doesn't work, though.

vaibhav-bansal commented 7 years ago

Yipee! It works perfectly. Thank you so much Sir!! πŸ˜„ πŸ˜†

eerohele commented 7 years ago

Glad to hear it. I'll close this one, but feel free to comment if you discover any other aspects related to this issue.