You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@lenya.apache.org by Joe Grist <jo...@andersonmorgan.com.au> on 2005/05/24 02:40:24 UTC

Missing DocType

Hi All

Quick question - my live Lenya site appears to have stopped rendering a
<!DOCTYPE.. > declaration in the generated HTML.

This is causing havoc with IE browsers.

I can't see what part of the XSLT causes this tag to be rendered.  Can
anybody help me find it so I can fix my site?
 
Joe Grist
Anderson Morgan Consulting Pty Ltd
PO Box 141 New Town 7008
6278 3387 / 0400 887 081
Joeg - at- andersonmorgan.com.au / www.andersonmorgan.com.au
<http://www.andersonmorgan.com.au/> 
 


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
For additional commands, e-mail: user-help@lenya.apache.org


Re: Missing DocType

Posted by Doug Chestnut <dh...@virginia.edu>.
I submitted a patch, lets hope it doesn't break something else ;-).

Joe Grist wrote:
> Doug
> 
> The below seems to work really well (once I resave and republish the pages).
> Thanks heaps. 
> BTW I am still running 1.2.2, trying to find the time to upgrade.
> 
> Should I add this to the wiki?
> 
> 
> 
>>Try changing
>>                  <map:transform type="write-source">
>>                   <map:parameter name="serializer" value="html-no-dtd"/>
>>                  </map:transform>
>>to                  <map:transform type="write-source">
>>                   <map:parameter name="serializer" value="html"/>
>>                  </map:transform>
> 
> 
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
> For additional commands, e-mail: user-help@lenya.apache.org
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
For additional commands, e-mail: user-help@lenya.apache.org


RE: Missing DocType

Posted by Joe Grist <jo...@andersonmorgan.com.au>.
Doug

The below seems to work really well (once I resave and republish the pages).
Thanks heaps. 
BTW I am still running 1.2.2, trying to find the time to upgrade.

Should I add this to the wiki?


> Try changing
>                   <map:transform type="write-source">
>                    <map:parameter name="serializer" value="html-no-dtd"/>
>                   </map:transform>
> to                  <map:transform type="write-source">
>                    <map:parameter name="serializer" value="html"/>
>                   </map:transform>





---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
For additional commands, e-mail: user-help@lenya.apache.org


Re: Missing DocType

Posted by Doug Chestnut <dh...@virginia.edu>.
Opps, that suggestion didn't work.  The cache wasn't being written out 
as valid xhtml (used html serializer) and was causing problems with the 
file generator.  Plus the generator and serializer add overhead that the 
caching is supposed to do away with, the map:read should be much faster.

Try changing
                  <map:transform type="write-source">
                   <map:parameter name="serializer" value="html-no-dtd"/>
                  </map:transform>
to
                  <map:transform type="write-source">
                   <map:parameter name="serializer" value="html"/>
                  </map:transform>

Hope this helps,
--Doug

Doug Chestnut wrote:
> Hi Joe,
> As Gregor said it is the serializer that adds the doc type.  Which 
> version of lenya is your pub based on?  If your publication-sitemap.xmap 
> has a matcher like the one at the bottom of my email in it, the new 
> cache stuff might be to blame.  I tried the default pub in 1.2.3 and 
> found that the first time I request a page I get the doctype, after that 
> there is no doctype.  I would try changing
> <map:read src="{global:cache-dir}/{../1}.html" mime-type="text/html"/>
> to
> <map:generate src="{global:cache-dir}/{../1}.html" type="file"/>
> <map:serialize type="html"/>
> 
> I don't think that map:read adds a doctype.  Hope this helps, let me 
> know how it works out.  :-)


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
For additional commands, e-mail: user-help@lenya.apache.org


Re: Missing DocType

Posted by Doug Chestnut <dh...@virginia.edu>.
Sure, I will test it and submit a patch :-).

Gregor J. Rothfuss wrote:
> Doug Chestnut wrote:
> 
>> Hi Joe,
>> As Gregor said it is the serializer that adds the doc type.  Which 
>> version of lenya is your pub based on?  If your 
>> publication-sitemap.xmap has a matcher like the one at the bottom of 
>> my email in it, the new cache stuff might be to blame.  I tried the 
>> default pub in 1.2.3 and found that the first time I request a page I 
>> get the doctype, after that there is no doctype.  I would try changing
>> <map:read src="{global:cache-dir}/{../1}.html" mime-type="text/html"/>
>> to
>> <map:generate src="{global:cache-dir}/{../1}.html" type="file"/>
>> <map:serialize type="html"/>
> 
> 
> ah! a bug with the static caching then. can you file it? basically when 
> the document is written out to the cache using the domstreamer it seems 
> to nuke the doctype. good catch doug
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
> For additional commands, e-mail: user-help@lenya.apache.org
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
For additional commands, e-mail: user-help@lenya.apache.org


Re: Missing DocType

Posted by "Gregor J. Rothfuss" <gr...@apache.org>.
Doug Chestnut wrote:
> Hi Joe,
> As Gregor said it is the serializer that adds the doc type.  Which 
> version of lenya is your pub based on?  If your publication-sitemap.xmap 
> has a matcher like the one at the bottom of my email in it, the new 
> cache stuff might be to blame.  I tried the default pub in 1.2.3 and 
> found that the first time I request a page I get the doctype, after that 
> there is no doctype.  I would try changing
> <map:read src="{global:cache-dir}/{../1}.html" mime-type="text/html"/>
> to
> <map:generate src="{global:cache-dir}/{../1}.html" type="file"/>
> <map:serialize type="html"/>

ah! a bug with the static caching then. can you file it? basically when 
the document is written out to the cache using the domstreamer it seems 
to nuke the doctype. good catch doug



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
For additional commands, e-mail: user-help@lenya.apache.org


Re: Missing DocType

Posted by Doug Chestnut <dh...@virginia.edu>.
Hi Joe,
As Gregor said it is the serializer that adds the doc type.  Which 
version of lenya is your pub based on?  If your publication-sitemap.xmap 
has a matcher like the one at the bottom of my email in it, the new 
cache stuff might be to blame.  I tried the default pub in 1.2.3 and 
found that the first time I request a page I get the doctype, after that 
there is no doctype.  I would try changing
<map:read src="{global:cache-dir}/{../1}.html" mime-type="text/html"/>
to
<map:generate src="{global:cache-dir}/{../1}.html" type="file"/>
<map:serialize type="html"/>

I don't think that map:read adds a doctype.  Hope this helps, let me 
know how it works out.  :-)


       <map:match pattern="**.html">
         <map:act type="language-exists">
           <map:select type="resource-exists">
             <map:when test="{global:cache-dir}/{../1}.html">
               <map:read src="{global:cache-dir}/{../1}.html"
mime-type="text/html"/>
             </map:when>
             <map:otherwise>
               <map:generate 
src="cocoon:/lenyabody-view/{page-envelope:publication-id}/{page-envelope:area}/{page-envelope:document-
type}{page-envelope:document-url}"/>
               <map:match pattern="authoring/**.html">
                 <map:transform 
src="cocoon://lenya-page/{page-envelope:publication-id}/{../../1}.xml?doctype={page-envelope:document
-type}"/>
               </map:match>
               <map:transform src="../../xslt/util/strip_namespaces.xsl"/>
               <map:match pattern="live/**.html">
                 <map:transform 
src="../../xslt/authoring/edit/addSourceTags.xsl">
                   <map:parameter name="source" 
value="{global:cache-dir}/live/{1}.html"/>
                 </map:transform>
                 <map:transform type="write-source">
                   <map:parameter name="serializer" value="html-no-dtd"/>
                 </map:transform>
                 <map:transform 
src="../../xslt/authoring/edit/removeSourceTags.xsl"/>
               </map:match>
               <map:serialize type="html"/>
             </map:otherwise>
           </map:select>
         </map:act>

         <!-- There is no version of the requested document-id for the
              requested language. -->
         <map:generate type="serverpages" 
src="../../content/exception/missing-language.xsp"/>
         <map:transform src="../../xslt/exception/missing-language.xsl"/>
         <map:call resource="style-cms-page"/>

       </map:match>

Gregor J. Rothfuss wrote:
> Joe Grist wrote:
> 
>> Quick question - my live Lenya site appears to have stopped rendering a
>> <!DOCTYPE.. > declaration in the generated HTML.
>>
>> This is causing havoc with IE browsers.
>>
>> I can't see what part of the XSLT causes this tag to be rendered.  Can
>> anybody help me find it so I can fix my site?
> 
> 
> it is not the xslt that does this, but the serialization step. make sure 
> the doctype is declared for the html case in sitemap.xmap
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
> For additional commands, e-mail: user-help@lenya.apache.org
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
For additional commands, e-mail: user-help@lenya.apache.org


Re: Missing DocType

Posted by "Gregor J. Rothfuss" <gr...@apache.org>.
Joe Grist wrote:

> Quick question - my live Lenya site appears to have stopped rendering a
> <!DOCTYPE.. > declaration in the generated HTML.
> 
> This is causing havoc with IE browsers.
> 
> I can't see what part of the XSLT causes this tag to be rendered.  Can
> anybody help me find it so I can fix my site?

it is not the xslt that does this, but the serialization step. make sure 
the doctype is declared for the html case in sitemap.xmap

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
For additional commands, e-mail: user-help@lenya.apache.org