Bug 43050

Summary: This page is not Valid XHTML 1.0 Strict
Product: Lenya Reporter: Ivan Izaguirre <ivan.izaguirre>
Component: Site ManagementAssignee: Lenya Developers <dev>
Status: REOPENED ---    
Severity: major CC: ivan.izaguirre
Priority: P2    
Version: 1.2.5   
Target Milestone: 1.2.6   
Hardware: Other   
OS: Linux   
URL: http://www.whitebearsolutions.com
Attachments: [PATCH] This page is Valid XHTML 1.0 Strict

Description Ivan Izaguirre 2007-08-06 12:18:09 UTC
This page is not Valid XHTML 1.0 Strict because missing xmlns attribute for
element html. The value should be: http://www.w3.org/1999/xhtml.

Ej: <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

I put this attribute in lenya/{pub}/xslt/page2xhtml.xsl but no append this.

I try modify the file lenya/xslt/util/strip_namespaces.xsl but this attribute no
append in page code.
Comment 1 Ivan Izaguirre 2007-08-07 04:57:30 UTC
New file lenya/lenya/xslt/util/strip_namespaces.xsl of 2007-07-24

<!--
The XHTML namespace is declared as the default namespace
to cause the stylesheet to output XHTML using the empty string
as namespace prefix (<html> instead of <xhtml:html>).
-->

<!-- $Id: strip_namespaces.xsl 559100 2007-07-24 16:55:19Z nettings $ -->
<xsl:stylesheet version="1.0"
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  xmlns="http://www.w3.org/1999/xhtml">

  <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>

  <xsl:template match="*">
    <xsl:element name="{local-name()}" namespace="{namespace-uri()}">
      <xsl:copy-of select="@*"/>
      <xsl:apply-templates/>
    </xsl:element>
  </xsl:template>

  <!-- fixme: this might be generalized to also pass on processing instructions
etc...-->
  <xsl:template match="comment()">
    <xsl:copy/>
  </xsl:template>

  <!--
    Workaround to prevent the serializer from collapsing these
    elements, since browsers currently can not handle things like
      <textarea/>
    The XHTML serializer currently used by Lenya can not be
    configured to avoid this collapsing; as long as that is the case
    this workaround is needed.
    -->
  <xsl:template match="textarea|script|style">
   <xsl:element name="{local-name()}">
      <xsl:copy-of select="@*"/>
      <xsl:apply-templates/>
          <xsl:if test="string-length(.) = 0"><xsl:text> </xsl:text></xsl:if>
    </xsl:element>
  </xsl:template>
</xsl:stylesheet>
Comment 2 J 2007-08-07 05:08:03 UTC
you should not mark a bug "resolved fixed" unless the fix is in the repository.
can you create a patch with your fix and attach it here?
Comment 3 Ivan Izaguirre 2007-08-07 10:18:42 UTC
(In reply to comment #2)
> you should not mark a bug "resolved fixed" unless the fix is in the repository.
> can you create a patch with your fix and attach it here?
> 
The fix is en the repository lenya 2.0.x. It's a new file
lenya/lenya/xslt/util/strip_namespaces.xsl
Comment 4 J 2007-08-07 13:16:25 UTC
i don't understand. the bug was reported for 1.2.5...
what i meant is it should only be marked fixed when it's fixed in the 1.2.5 branch.
Comment 5 Ivan Izaguirre 2007-08-08 00:22:49 UTC
(In reply to comment #4)
> i don't understand. the bug was reported for 1.2.5...
> what i meant is it should only be marked fixed when it's fixed in the 1.2.5
branch.
> 

OK, I'm sorry.
Comment 6 Ivan Izaguirre 2007-08-09 07:45:22 UTC
Created attachment 20624 [details]
[PATCH] This page is Valid XHTML 1.0 Strict

This file is present on lenya 2.0.x