facebook

XML – bad DTD error [Closed]

  1. MyEclipse IDE
  2.  > 
  3. General Development
Viewing 15 posts - 1 through 15 (of 22 total)
  • Author
    Posts
  • #205307 Reply

    Erez
    Member

    I’v got this XML file in my Web module which starts like this:

    
    <?xml version="1.0" encoding="UTF-8" ?>
    
    <!DOCTYPE securityfilter-config PUBLIC
        "-//SecurityFilter.org//DTD Security Filter Configuration 1.1//EN"
        "http://www.securityfilter.org/dtd/securityfilter-config_1_1.dtd">
    
    ...
    ...
    

    In the ‘problems’ pane I get the following error:

    “The markup declarations contained or pointed to by the document type declaration must be well-formed.”

    How can I get rid of this?

    Thanks,

    Erez

    #205311 Reply

    Scott Anderson
    Participant

    Erez,

    Is your file well-formed below the DOCTYPE line? For example does it contain a securityfilter-config as the root element? Taking the header you have and appending <securityfilter-config/> to the file makes it well-formed.

    #205333 Reply

    Erez
    Member

    I do have it – here is my XML file (not too long)

    
    <?xml version="1.0" encoding="UTF-8" ?>
    
    <!DOCTYPE securityfilter-config PUBLIC
        "-//SecurityFilter.org//DTD Security Filter Configuration 1.1//EN"
        "http://www.securityfilter.org/dtd/securityfilter-config_1_1.dtd">
    
    <securityfilter-config>
    
       <security-constraint>
          <web-resource-collection>
             <web-resource-name>Secured Area</web-resource-name>
             <url-pattern>/user/*</url-pattern>
          </web-resource-collection>
          <auth-constraint>
             <role-name>User</role-name>
             <role-name>Operator</role-name>
             <role-name>Admin</role-name>
          </auth-constraint>
          <user-data-constraint>
            <description></description>
            <transport-guarantee>NONE</transport-guarantee>
          </user-data-constraint>
       </security-constraint>
    
       <login-config>
          <auth-method>FORM</auth-method>
          <form-login-config>
             <form-login-page>/index.jsp</form-login-page>
             <form-error-page>/index.jsp</form-error-page>
             <form-default-page>/user/Login.do</form-default-page>
          </form-login-config>
       </login-config>
                             
       <security-role>
        <description>Site Admnistrator</description>
        <role-name>Admin</role-name>
       </security-role>
       <security-role>
        <description>A member of the site system stuff</description>
        <role-name>Operator</role-name>
       </security-role>
       <security-role>
        <description>Simple user of this site</description>
        <role-name>User</role-name>
       </security-role>
    
       <realm className="securityFilter.JBossRealmAdapter" />
    
    </securityfilter-config>
    

    Is this well formed ?

    Erez

    #205335 Reply

    Scott Anderson
    Participant

    Erez,

    It’s fine. I pasted it into an XML file using our editor and it validated just fine. Are you sure you’re using our XML editor? Which version of the product? Is validation turned on?

    #205339 Reply

    Riyad Kalla
    Member

    Erez,
    When you right click on your XML file, go to “Open With” andmake sure the default is “MyEclipse XML Editor”, its possible it is some other editor.

    #205363 Reply

    Erez
    Member

    I’ve checked and everything is in place:

    First, I am running the 3.7.0 M7 version on Win XP.

    – the MyEclipse XML Editor is marked as the default editor.
    – Under the Windows/properties/MyEclipse/Editors/XML Editors/Configuration I have the following:

    1. validate: only Deployment Descriptors
    2. Use cache for DTDs (checked)
    3. Suppress warning for non-default file encoding

    By the way the error marker (red X) is placed next to the first row:

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

    Erez

    #205374 Reply

    support-michael
    Keymaster

    I’m curious if an error marker has been attached to the file in question and some how is not being cleared (not likely).

    A couple of more things to try:

    1) Try creating a new XML file and paste the contents of the file you posted. Then save and validate that file to see if the error marker appears.

    2) Rebuild Project, Project->Rebuild Project

    #205426 Reply

    Erez
    Member

    I tried everything you told me to do, but it still shows the error, and yes, it does show a small error marker (“X”) next to the file and next to the containing project as well.

    Erez

    #205427 Reply

    Riyad Kalla
    Member

    Erez, can you refresh your project, close it, close Eclipse, reload Eclipse and reopen your project THEN rebuild project and see what happens?

    #205437 Reply

    Erez
    Member

    Riyad,

    I have done it all – close all three related projects (EAR, EJB, and Web), closed Eclipse, reload, and rebuild all but no go… 🙁

    A very sticky error..

    Erez

    #205441 Reply

    Riyad Kalla
    Member

    Good god that is a sticky error…

    Ok lets try this. Cut-paste the contents of the XML file from Eclipse into an empty Notepad window. Then delete the file from your project, does the error go away? Ok, now create a new XML file (with same name) and paste the contents back in.

    Did that work?

    #205627 Reply

    Nathan
    Member

    I have the same thing happening….The xml file in question has never had this problem before and has not been edited — the only thing that has changed is a new version of myeclipse / eclipse…..any ideas?

    #205632 Reply

    Riyad Kalla
    Member

    Nathan, did you try the last suggestion I Made to Erez?

    #205700 Reply

    beskow
    Member

    Hi,

    I’m experiencing exactly the same problem with a struts validator file, using the doctype

    <!DOCTYPE form-validation PUBLIC
    “-//Apache Software Foundation//DTD Commons Validator Rules Configuration 1.1//EN”
    http://jakarta.apache.org/commons/dtds/validator_1_1.dtd”&gt;

    /Bjorn

    #205701 Reply

    Riyad Kalla
    Member

    Bjorn,
    Did you try the suggestion that I made to Nathan, which was originally made to Erez?

    Ok lets try this. Cut-paste the contents of the XML file from Eclipse into an empty Notepad window. Then delete the file from your project, does the error go away? Ok, now create a new XML file (with same name) and paste the contents back in.

Viewing 15 posts - 1 through 15 (of 22 total)
Reply To: XML – bad DTD error [Closed]

You must be logged in to post in the forum log in