refer to dtd present in github

Hi

I need to refer to a dtd present in git bub at
https://github.com/3pintech/fastcode/blob/master/resources/template.dtd

in my xml. I m using it like below:

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


When i parse the xml, i get the below error:

[Fatal Error] template.dtd:4:3: The markup declarations contained or pointed to by the document type declaration must be well-formed.

If i put the same dtd in my local drive and refer to it like this

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

<!DOCTYPE templates SYSTEM "C:/abc/IntelliJProjects/project_1/resources/template.dtd">


It works fine.

I m using Intellij 12.0.1
Can you please point out what could be wrong.

5 comments
Comment actions Permalink

The link you've posted is a link to a page on GitHub which contains a lot of markup in addition to the contents of the DTD file, and most definitely isn't a valid DTD. You need to use the raw contents link instead: https://raw.githubusercontent.com/3pintech/fastcode/master/resources/template.dtd

0
Comment actions Permalink

Thank You Sir....With the URL you suggested it works fine.

0
Comment actions Permalink

I have this xml as part of my plugin. I did "prepare plugin for deployment" and insatalled the jar. When i invoke my plugin,, the part of code that parses this xml throws the below error.

java.net.SocketException: Permission denied: connect
        at java.net.TwoStacksPlainSocketImpl.socketConnect(Native Method)

Do we have to set some permission so that the plugin is able to connect to the said DTD?

0
Comment actions Permalink

I would strongly recommend you to download that DTD file and include it in the resources of your plugin, so that the users of your plugin would not need to perform network requests to Github servers.

0
Comment actions Permalink

Hi

I have included the dtd along with my resources. Now the xml and the dtd stay in the same folder.
I tried refering to the dtd as below, in my xml.

<!DOCTYPE templates SYSTEM "template.dtd">

Then deployed the plugin, the XML does not get parsed.

How should i refer to the dtd in this case?

0

Please sign in to leave a comment.