--- maven-pdf-plugin-2.2.1-orig/plugin-resources/project2fo.xslt	2004-10-30 12:06:18.000000000 +0000
+++ maven-pdf-plugin-2.2.1/plugin-resources/project2fo.xslt	2005-06-08 17:39:31.404652088 +0000
@@ -49,7 +49,7 @@
     <xsl:variable name="colorMediumGray">#A9A9A9</xsl:variable>
     <xsl:variable name="colorLightGray">#D3D3D3</xsl:variable>
     <xsl:variable name="colorWarmGrey11">#4b4542</xsl:variable>
-    <xsl:output method="xml" encoding="UTF-8" indent="yes" omit-xml-declaration="no"/>
+    <xsl:output method="xml" encoding="UTF-8" indent="no" omit-xml-declaration="no"/>
     <!-- Templates -->
     <xsl:template match="/">
         <xsl:apply-templates select="project"/>
@@ -68,12 +68,18 @@
     <xsl:template match="project/body/menu">
         <xsl:apply-templates/>
     </xsl:template>
+    <xsl:template match="project/body/footer">
+        <!-- Ignore footer -->
+    </xsl:template>
     <xsl:template match="project/body/menu/item">
         <!-- Renders the xml xdoc document -->
         <xsl:call-template name="render-xdoc">
             <xsl:with-param name="chapterNumber">
                 <xsl:number count="menu"/>.<xsl:number count="menu/item"/>
             </xsl:with-param>
+            <xsl:with-param name="fileName">
+                    <xsl:value-of select="substring-after(translate(normalize-space(@href),'\','/'),'/')"/>
+            </xsl:with-param>
         </xsl:call-template>
         <xsl:apply-templates/>
     </xsl:template>
@@ -83,6 +89,9 @@
             <xsl:with-param name="chapterNumber">
                 <xsl:number count="menu"/>.<xsl:number count="menu/item"/>.<xsl:number count="menu/item/item"/>
             </xsl:with-param>
+            <xsl:with-param name="fileName">
+                    <xsl:value-of select="substring-after(translate(normalize-space(@href),'\','/'),'/')"/>
+            </xsl:with-param>
         </xsl:call-template>
         <xsl:apply-templates/>
     </xsl:template>
@@ -92,10 +101,14 @@
             <xsl:with-param name="chapterNumber">
                 <xsl:number count="menu"/>.<xsl:number count="menu/item"/>.<xsl:number count="menu/item/item"/>.<xsl:number count="menu/item/item/item"/>
             </xsl:with-param>
+            <xsl:with-param name="fileName">
+                    <xsl:value-of select="substring-after(translate(normalize-space(@href),'\','/'),'/')"/>
+            </xsl:with-param>
         </xsl:call-template>
     </xsl:template>
     <xsl:template name="render-xdoc">
         <xsl:param name="chapterNumber">Foo</xsl:param>
+        <xsl:param name="fileName">Bar</xsl:param>
         <!-- Set the page number to start at. Normally this is 'auto'
          unless we are at the very first xdoc, in which case we reset it to 1 -->
         <xsl:variable name="pageStart">
@@ -140,12 +153,16 @@
                     <xsl:with-param name="chapterNumber">
                         <xsl:value-of select="$chapterNumber"/>
                     </xsl:with-param>
+                    <xsl:with-param name="fileName">
+                        <xsl:value-of select="$fileName"/>
+                    </xsl:with-param>
                     <xsl:with-param name="chapter">
                         <xsl:value-of select="@name"/>
                     </xsl:with-param>
                 </xsl:call-template>
                 <!-- Render the associated xdoc -->
-                <fo:block id="{@href}{generate-id()}">
+                <fo:block id="{@href}{generate-id()}"/>
+                <fo:block id="{$fileName}">
                     <xsl:choose>
                         <xsl:when test="not(starts-with($href, 'http'))">
                             <xsl:variable name="documentPath" select="concat(normalize-space($basePath),normalize-space( $documentName), '.xml')"/>
@@ -157,6 +174,9 @@
                                 <xsl:with-param name="chapterNumber">
                                     <xsl:value-of select="$chapterNumber"/>
                                 </xsl:with-param>
+                                <xsl:with-param name="fileName">
+                                    <xsl:value-of select="$fileName"/>
+                                </xsl:with-param>
                             </xsl:apply-templates>
                         </xsl:when>
                         <xsl:otherwise>

