Results 1 to 3 of 3

Thread: Doctype line left out from XML template

  1. #1
    Join Date
    Feb 2005
    Posts
    25

    Default 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. #2
    Join Date
    Mar 2008
    Location
    Sydney, AU
    Posts
    974

    Default

    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

  3. #3
    Join Date
    Jan 2010
    Location
    Lanus, Argentina
    Posts
    28

    Default

    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •