Author: sebb
Date: Mon Apr  4 16:46:50 2005
New Revision: 160117

URL: http://svn.apache.org/viewcvs?view=rev&rev=160117
Log:
Changes to ensure JDK1.4 and 1.5 generate identical output:
- change all multi-attribute tags to use xsl:attribute
- remove trailing whitespace from JDK1.4 output
Also:
- use © rather than numeric equivalent
- remove xml header from html files
- add meta header content type

Modified:
    jakarta/site/build.xml
    jakarta/site/xdocs/downloads/download-pages.xsl
    jakarta/site/xdocs/stylesheets/site.xsl

Modified: jakarta/site/build.xml
URL: 
http://svn.apache.org/viewcvs/jakarta/site/build.xml?view=diff&r1=160116&r2=160117
==============================================================================
--- jakarta/site/build.xml (original)
+++ jakarta/site/build.xml Mon Apr  4 16:46:50 2005
@@ -32,9 +32,6 @@
     </condition>
     <fail unless="target.vm" message="Must build with Java 1.4/1.5"/>
 
-
-    <antcall target="jdk14-warning"/>
-
     <!-- Create destination directory if necessary -->
     <mkdir     dir="${docs.dest}"/>
 
@@ -150,13 +147,16 @@
     </copy>
 -->
        
+       <antcall target="jdk14-remove-ws"></antcall>
+       
   </target>
 
-  <target name="jdk14-warning" if="jdk14">
-      <echo>==== IT IS HIGHLY RECOMMENDED THAT YOU BUILD WITH JDK 1.5 
====</echo>
-      <echo>Building with 1.4 requires magic that hopefully will work, and 
will change the style of the html, leading to large SVN diffs. </echo>
-      <sleep seconds="5"/>
-      <echo>Continuing anyway...</echo>
+  <!-- Process JDK1.4 output to remove the trailing blank spaces -->
+  <target name="jdk14-remove-ws" if="jdk14">
+       <echo>*** Removing extra white-space</echo>
+       <replace dir="${docs.dest}" token=" />" value="/>">
+               <include name="**/*.html"/>
+       </replace>
   </target>
 
   <target name="javadocs"

Modified: jakarta/site/xdocs/downloads/download-pages.xsl
URL: 
http://svn.apache.org/viewcvs/jakarta/site/xdocs/downloads/download-pages.xsl?view=diff&r1=160116&r2=160117
==============================================================================
--- jakarta/site/xdocs/downloads/download-pages.xsl (original)
+++ jakarta/site/xdocs/downloads/download-pages.xsl Mon Apr  4 16:46:50 2005
@@ -1,9 +1,21 @@
 <?xml version="1.0" encoding="ISO-8859-1"?>
 
+<!-- Stylesheet to generate intermediate XML files which are later processed 
by site.xsl -->
+
 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; version="1.0" 
   xmlns:redirect="http://xml.apache.org/xalan/redirect";
   extension-element-prefixes="redirect">
 
+<!--
+       N.B. any tags with more than one attribute need to be coded using 
xsl:attribute 
+       for all but the first attribute.
+       This is to ensure that JDK 1.4 and 1.5 generate the attributes in the 
same order.       
+-->
+<!--
+       Warning: 
+       There seems to be a bug in JDK 1.5.0_02 - if you try to use 
indent="yes" with redirect:write,
+       some files can be mangled at the start of the output.
+-->
   <!-- Defined parameters (overrideable) -->
   <xsl:param    name="docs.downloads.tmp" select="'target/download-xdocs'"/>
 
@@ -33,10 +45,15 @@
             encounter a problem with this mirror, please select another
             mirror.  If all mirrors are failing, there are <i>backup</i>
             mirrors (at the end of the mirrors list) that should be
-            available.<br/>[if-any logo]<a href="[link]"><img align="right" 
src="[logo]" border="0" /></a>[end]</p>
+            available.<br/>[if-any logo]<a href="[link]"><img align="right">
+            <xsl:attribute name="src"><xsl:value-of 
select="'[logo]'"/></xsl:attribute>
+            <xsl:attribute name="border"><xsl:value-of 
select="'0'"/></xsl:attribute>
+            </img></a>[end]</p>
 
             <p>
-            <form action="[location]" method="get" id="SelectMirror">
+            <form action="[location]">
+            <xsl:attribute name="method"><xsl:value-of 
select="'get'"/></xsl:attribute>
+            <xsl:attribute name="id"><xsl:value-of 
select="'SelectMirror'"/></xsl:attribute>
               Other mirrors: <select name="Preferred">
               [if-any http]
                 [for http]<option value="[http]">[http]</option>[end]
@@ -48,7 +65,9 @@
                 [for backup]<option value="[backup]">[backup] 
(backup)</option>[end]
               [end]
               </select>
-              <input type="submit" value="Change" />
+              <input type="submit">
+              <xsl:attribute name="value"><xsl:value-of 
select="'Change'"/></xsl:attribute>
+              </input>
             </form>
             </p>
         </xsl:if>
@@ -68,7 +87,9 @@
         </xsl:if>
 
         <xsl:if test="@name and @href">
-            <p>For more information concerning <xsl:value-of select="@name"/>, 
see the <a href="{$href}" class="name"><xsl:value-of select="@name"/></a> site. 
</p>
+            <p>For more information concerning <xsl:value-of select="@name"/>, 
see the <a href="{$href}">
+            <xsl:attribute name="class"><xsl:value-of 
select="'name'"/></xsl:attribute>
+            <xsl:value-of select="@name"/></a> site. </p>
         </xsl:if>
 
           <xsl:if test="project">

Modified: jakarta/site/xdocs/stylesheets/site.xsl
URL: 
http://svn.apache.org/viewcvs/jakarta/site/xdocs/stylesheets/site.xsl?view=diff&r1=160116&r2=160117
==============================================================================
--- jakarta/site/xdocs/stylesheets/site.xsl (original)
+++ jakarta/site/xdocs/stylesheets/site.xsl Mon Apr  4 16:46:50 2005
@@ -1,14 +1,10 @@
 <?xml version="1.0" encoding="ISO-8859-1"?>
 <!-- Content Stylesheet for "jakarta-site2" Documentation -->
 
-<!-- NOTE:  Changes here should also be reflected in "site.vsl" and vice
-     versa, so either Anakia or XSLT can be used for document generation.   -->
-
-
-<!-- Outstanding Compatibility Issues (with Anakia-based stylesheets):
-
-* Handling of the <image> element to insert relative path prefixes
-
+<!--
+       N.B. any tags with more than one attribute need to be coded using 
xsl:attribute 
+       for all but the first attribute.
+       This is to ensure that JDK 1.4 and 1.5 generate the attributes in the 
same order.       
 -->
 
 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
@@ -17,6 +13,7 @@
   <!-- Output method -->
 
   <xsl:output method="xml"
+        omit-xml-declaration = "yes"
             encoding="iso-8859-1"
             doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN"
             doctype-system="http://www.w3.org/TR/html4/loose.dtd";
@@ -34,9 +31,15 @@
 
     <html>
     <head>
+       <meta http-equiv="Content-Type">
+    <xsl:attribute name="content"><xsl:value-of select="'text/html; 
charset=iso-8859-1'"/></xsl:attribute>
+       </meta> 
     <xsl:apply-templates select="meta"/>
     <title><xsl:value-of select="$site/title"/> - <xsl:value-of 
select="properties/title"/></title>
-    <link rel="stylesheet" href="/style/style.css" type="text/css" />
+    <link rel="stylesheet">
+    <xsl:attribute name="href"><xsl:value-of 
select="'/style/style.css'"/></xsl:attribute>
+    <xsl:attribute name="type"><xsl:value-of 
select="'text/css'"/></xsl:attribute>
+    </link>
     <xsl:for-each select="properties/author">
       <xsl:variable name="name">
         <xsl:value-of select="."/>
@@ -44,8 +47,12 @@
       <xsl:variable name="email">
         <xsl:value-of select="@email"/>
       </xsl:variable>
-      <meta name="author" value="{$name}"/>
-      <meta name="email" value="{$email}"/>
+      <meta name="author">
+      <xsl:attribute name="value"><xsl:value-of 
select="$name"/></xsl:attribute>
+      </meta>
+      <meta name="email">
+      <xsl:attribute name="value"><xsl:value-of 
select="$email"/></xsl:attribute>
+      </meta>
     </xsl:for-each>
     <xsl:if test="properties/base">
       <base href="{properties/base/@href}"/>
@@ -54,15 +61,20 @@
 
     <body>
 
-    <table class="page-header" border="0" width="100%" cellspacing="0">
+    <table class="page-header">
+      <xsl:attribute name="border"><xsl:value-of select="'0'"/></xsl:attribute>
+      <xsl:attribute name="width"><xsl:value-of 
select="'100%'"/></xsl:attribute>
+      <xsl:attribute name="cellspacing"><xsl:value-of 
select="'0'"/></xsl:attribute>
 
       <xsl:comment>PAGE HEADER</xsl:comment>
       <tr><td colspan="2">
 
         <xsl:comment>JAKARTA LOGO</xsl:comment>
         <a href="http://jakarta.apache.org/";>
-          <img src="http://jakarta.apache.org/images/jakarta-logo.gif";
-             alt="The Jakarta Project" border="0"/>
+          <img src="http://jakarta.apache.org/images/jakarta-logo.gif";>
+          <xsl:attribute name="alt"><xsl:value-of select="'The Jakarta 
Project'"/></xsl:attribute>
+          <xsl:attribute name="border"><xsl:value-of 
select="'0'"/></xsl:attribute>
+          </img>
         </a>
         <xsl:if test="$site/logo">
           <xsl:variable name="alt">
@@ -84,22 +96,30 @@
       </td></tr>
 
       </table>
-      <table border="0" width="100%" cellspacing="4">
+      <table border="0">
+      <xsl:attribute name="width"><xsl:value-of 
select="'100%'"/></xsl:attribute>
+      <xsl:attribute name="cellspacing"><xsl:value-of 
select="'4'"/></xsl:attribute>
 
       <tr>
 
         <xsl:comment>LEFT SIDE NAVIGATION</xsl:comment>
-        <td class="left-navbar" valign="top" nowrap="nowrap">
+        <td class="left-navbar">
+          <xsl:attribute name="valign"><xsl:value-of 
select="'top'"/></xsl:attribute>
+          <xsl:attribute name="nowrap"><xsl:value-of 
select="'nowrap'"/></xsl:attribute>
           <xsl:apply-templates select="$site/body/[EMAIL 
PROTECTED]'lhs']/menu"/>
         </td>
 
         <xsl:comment>MAIN BODY</xsl:comment>
-        <td class="main-body" valign="top" align="left">
+        <td class="main-body">
+          <xsl:attribute name="valign"><xsl:value-of 
select="'top'"/></xsl:attribute>
+          <xsl:attribute name="align"><xsl:value-of 
select="'left'"/></xsl:attribute>
           <xsl:apply-templates select="body/section"/>
         </td>
 
         <xsl:comment>RIGHT SIDE NAVIGATION</xsl:comment>
-        <td class="right-navbar" valign="top" nowrap="nowrap">
+        <td class="right-navbar">
+          <xsl:attribute name="valign"><xsl:value-of 
select="'top'"/></xsl:attribute>
+          <xsl:attribute name="nowrap"><xsl:value-of 
select="'nowrap'"/></xsl:attribute>
           <xsl:apply-templates select="$site/body/[EMAIL 
PROTECTED]'rhs']/menu"/>
         </td>
 
@@ -108,13 +128,15 @@
       <xsl:comment>FOOTER SEPARATOR</xsl:comment>
       <tr>
         <td colspan="3">
-          <hr noshade="noshade" size="1"/>
+          <hr noshade="noshade">
+          <xsl:attribute name="size"><xsl:value-of 
select="'1'"/></xsl:attribute>
+          </hr>
         </td>
       </tr>
 
       <tr><td colspan="3">
         <div class="page-footer"><em>
-        Copyright &#169; 1999-2005, The Apache Software Foundation. <a 
href="http://jakarta.apache.org/site/legal.html";>Legal information</a>.
+        Copyright <xsl:text disable-output-escaping = 
"yes">&amp;</xsl:text>copy; 1999-2005, The Apache Software Foundation. <a 
href="http://jakarta.apache.org/site/legal.html";>Legal information</a>.
         </em></div>
       </td></tr>
 
@@ -204,7 +226,9 @@
 
   <!-- specially process td tags ala site.vsl -->
   <xsl:template match="[EMAIL PROTECTED]'detail-table']/tr/td">
-    <td class="detail-table-content" valign="top" align="left">
+    <td class="detail-table-content">
+        <xsl:attribute name="valign"><xsl:value-of 
select="'top'"/></xsl:attribute>
+        <xsl:attribute name="align"><xsl:value-of 
select="'left'"/></xsl:attribute>
         <xsl:if test="@colspan"><xsl:attribute name="colspan"><xsl:value-of 
select="@colspan"/></xsl:attribute></xsl:if>
         <xsl:if test="@rowspan"><xsl:attribute name="rowspan"><xsl:value-of 
select="@rowspan"/></xsl:attribute></xsl:if>
         <xsl:apply-templates/>
@@ -213,7 +237,8 @@
   
   <!-- handle th ala site.vsl -->
   <xsl:template match="[EMAIL PROTECTED]'detail-table']/tr/th">
-    <td class="detail-table-header" valign="top">
+    <td class="detail-table-header">
+        <xsl:attribute name="valign"><xsl:value-of 
select="'top'"/></xsl:attribute>
         <xsl:if test="@colspan"><xsl:attribute name="colspan"><xsl:value-of 
select="@colspan"/></xsl:attribute></xsl:if>
         <xsl:if test="@rowspan"><xsl:attribute name="rowspan"><xsl:value-of 
select="@rowspan"/></xsl:attribute></xsl:if>
         <xsl:apply-templates />



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to