1 Reply Latest reply: Jul 12, 2012 6:13 AM by odie_63 RSS

    XML prolog question on PUBLIC

    800839
      Hi,

      I have a doubt on the below XML prolog ,

      <?xml version="1.0" encoding="UTF-8"?>
      <!DOCTYPE tiles-definitions PUBLIC "-//Apache Software Foundation//DTD Tiles Configuration 1.1//EN"
      "http://jakarta.apache.org/struts/dtds/tiles-config_1_2.dtd">

      This prolog says the tiles-config_1_2.dtd can be any where in the WEB hence it is made as PUBLIC?

      If it is like the below:-

      <?xml version="1.0" encoding="UTF-8"?>
      <!DOCTYPE tiles-definitions SYSTEM "tiles-config_1_2.dtd">

      In such case the tiles-config_1_2.dtd should be located in the classpath of the local system?

      For the first one to work, <!DOCTYPE tiles-definitions PUBLIC "-//Apache Software Foundation//DTD Tiles Configuration 1.1//EN"
      "http://jakarta.apache.org/struts/dtds/tiles-config_1_2.dtd"> we need to have an internet connection so that internally a search will be
      done and the respective tiles-config_1_2.dtd will be picked up.

      But in my machine I don't have an internet connection but still I am not getting an error and the same is working fine.
      How this is possible? Please clarify.

      Thanks.
        • 1. Re: XML prolog question on PUBLIC
          odie_63
          If it is like the below:-

          <?xml version="1.0" encoding="UTF-8"?>
          <!DOCTYPE tiles-definitions SYSTEM "tiles-config_1_2.dtd">

          In such case the tiles-config_1_2.dtd should be located in the classpath of the local system?
          Correct, in the classpath or any other path resolver that a tool may use.
          For the first one to work, <!DOCTYPE tiles-definitions PUBLIC "-//Apache Software Foundation//DTD Tiles Configuration 1.1//EN"
          "http://jakarta.apache.org/struts/dtds/tiles-config_1_2.dtd"> we need to have an internet connection so that internally a search will be
          done and the respective tiles-config_1_2.dtd will be picked up.
          Actually no.
          Contrary to SYSTEM, the PUBLIC doctype provides :
          a DTD name in the form of an FPI : -//Apache Software Foundation//DTD Tiles Configuration 1.1//EN
          a DTD url : http://jakarta.apache.org/struts/dtds/tiles-config_1_2.dtd

          Generally, tools that need access to DTDs rely on the FPI to find them.
          That means, somewhere in the installation, there has to be an XML/DTD catalog with key-value pairs describing where to find a local copy of the DTD associated with a given FPI.