Announcement Announcement Module
Collapse
No announcement yet.
Doctype line left out from XML template Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Doctype line left out from XML template

    I am reading a xml template file, parsing it and changing the contents than writing it back to the disk using the standard features you provide in the XmlUtils class. However there is the doctype line

    <!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit 1.7.1//EN" "http://google-web-toolkit.googlecode.com/svn/tags/1.7.1/distro-source/core/src/gwt-module.dtd">

    That does not make it into the destination file. Do you have any idea why ?

    Thanks,
    Dorel

  • #2
    You can play around with the jsp:output element. This should allow you to generate your doctype declaration:

    Code:
    <jsp:output doctype-root-element="module"
            doctype-public=""-//Google Inc.//DTD Google Web Toolkit 1.7.1//EN"" 
            doctype-system="http://google-web-toolkit.googlecode.com/svn/tags/1.7.1/distro-source/core/src/gwt-module.dtd" />
    I have not tested this but figured it could help to get you started.

    HTH
    -Stefan

    Comment


    • #3
      Hi!.. The idea is right but there's a problem with that, the jsp namespace hasn't been declared yet....it's in the next line.....for instance:

      Code:
      <jsp:output doctype-root-element="module"
              doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN" 
              doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" />
      <html 
       	xmlns:jsp="http://java.sun.com/JSP/Page"
      	xmlns:c="http://java.sun.com/jsp/jstl/core"
      	xmlns:tiles="http://tiles.apache.org/tags-tiles"
      	xmlns:form="http://www.springframework.org/tags/form"
      	xmlns:spring="http://www.springframework.org/tags"
      	xmlns:roo="urn:jsptagdir:/WEB-INF/tags" >
      this generates a compile time exception due to namespace not declared.

      I've tried this, adding a "root" element to the jspx document, as it is explained in the j2ee tutorial http://java.sun.com/j2ee/1.4/docs/tu...doc/JSPX3.html and its works fine!
      Example:

      Code:
      <root xmlns:jsp="http://java.sun.com/JSP/Page"
      	xmlns:c="http://java.sun.com/jsp/jstl/core"
      	xmlns:tiles="http://tiles.apache.org/tags-tiles"
      	xmlns:form="http://www.springframework.org/tags/form"
      	xmlns:spring="http://www.springframework.org/tags"
      	xmlns:roo="urn:jsptagdir:/WEB-INF/tags">
      <jsp:output doctype-root-element="module"
              doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN" 
              doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" />
      <html > ....the rest of the code

      Comment

      Working...
      X