[jboss-cvs] JBossAS SVN: r70827 - trunk/docbook-support/jbossorg-docbook-xslt/src/main/resources/xslt/org/jboss.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Thu Mar 13 12:26:49 EDT 2008
Author: newtonm
Date: 2008-03-13 12:26:49 -0400 (Thu, 13 Mar 2008)
New Revision: 70827
Modified:
trunk/docbook-support/jbossorg-docbook-xslt/src/main/resources/xslt/org/jboss/highlight-pdf.xsl
Log:
Added XML styles and output normal text for programlistings without a role attribute.
Modified: trunk/docbook-support/jbossorg-docbook-xslt/src/main/resources/xslt/org/jboss/highlight-pdf.xsl
===================================================================
--- trunk/docbook-support/jbossorg-docbook-xslt/src/main/resources/xslt/org/jboss/highlight-pdf.xsl 2008-03-13 16:02:26 UTC (rev 70826)
+++ trunk/docbook-support/jbossorg-docbook-xslt/src/main/resources/xslt/org/jboss/highlight-pdf.xsl 2008-03-13 16:26:49 UTC (rev 70827)
@@ -9,11 +9,11 @@
xmlns:fo="http://www.w3.org/1999/XSL/Format"
version="1.0"
xmlns:rf="java:org.jboss.highlight.FORendererFactory"
- xmlns:jhr="java:org.jboss.highlight.renderer.JavaFORenderer"
+ xmlns:jhr="java:org.jboss.highlight.renderer.FORenderer"
xmlns:jfr="org.jboss.highlight.renderer.Renderer"
exclude-result-prefixes="jhr,rf">
- <xsl:template match="programlisting[@role='XML']|programlisting[@role='JAVA']|programlisting[@role='XHTML']|programlisting[@role='JSP']|programlisting[@role='CSS']">
+ <xsl:template match="programlisting|programlisting[@role='XML']|programlisting[@role='JAVA']|programlisting[@role='XHTML']|programlisting[@role='JSP']|programlisting[@role='CSS']">
<xsl:variable name="role">
<xsl:value-of select="s:toUpperCase(string(@role))" xmlns:s="java:java.lang.String"/>
@@ -23,14 +23,23 @@
<xsl:apply-templates/>
</xsl:variable>
- <fo:block background-color="#F5F5F5" border-style="solid" border-width=".3mm" border-color="#CCCCCC" font-family="verdana,helvetica,sans-serif" space-before="12pt" space-after="12pt" linefeed-treatment="preserve" white-space-collapse="false" white-space-treatment="preserve">
+ <fo:block background-color="#F5F5F5"
+ border-style="solid"
+ border-width=".3mm"
+ border-color="#CCCCCC"
+ font-family="verdana,helvetica,sans-serif"
+ space-before="12pt"
+ space-after="12pt"
+ linefeed-treatment="preserve"
+ white-space-collapse="false"
+ white-space-treatment="preserve">
<xsl:variable name="factory" select="rf:instance()"/>
<xsl:variable name="hiliter" select="rf:getRenderer($factory, string($role))"/>
<xsl:choose>
<xsl:when test="$hiliter">
- <xsl:variable name="caller" select="jfr:parseText($hiliter, string($child.content), 'UTF-8')"/>
+ <xsl:variable name="caller" select="jfr:parseText($hiliter, $role, string($child.content), 'UTF-8')"/>
<xsl:variable name="noOfTokens" select="jhr:getNoOfTokens($caller)"/>
<xsl:call-template name="iterator">
@@ -38,6 +47,9 @@
<xsl:with-param name="noOfTokens" select="$noOfTokens"/>
</xsl:call-template>
</xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$child.content"/>
+ </xsl:otherwise>
</xsl:choose>
</fo:block>
@@ -51,10 +63,6 @@
<xsl:variable name="style" select="jhr:getStyle($caller, $i)"/>
<xsl:variable name="token" select="jhr:getToken($caller, $i)"/>
- <!--<xsl:if test="$token = '\n'">
- </fo:block>
- <fo:block>
- </xsl:if>-->
<xsl:choose>
<xsl:when test="$style = 'java_keyword'"> <fo:inline color="#7F1B55" font-weight="bold"> <xsl:value-of select="$token"/> </fo:inline></xsl:when>
@@ -66,6 +74,16 @@
<xsl:when test="$style = 'java_javadoc_comment'"> <fo:inline color="#3F5FBF" font-style="italic"> <xsl:value-of select="$token"/> </fo:inline></xsl:when>
<xsl:when test="$style = 'java_operator'"> <fo:inline color="#000000"> <xsl:value-of select="$token"/> </fo:inline></xsl:when>
<xsl:when test="$style = 'java_javadoc_tag'"> <fo:inline color="#7F9FBF" font-weight="bold" font-style="italic"> <xsl:value-of select="$token"/> </fo:inline></xsl:when>
+ <xsl:when test="$style = 'xml_plain'"> <fo:inline color="#000000"> <xsl:value-of select="$token"/> </fo:inline></xsl:when>
+ <xsl:when test="$style = 'xml_char_data'"> <fo:inline color="#000000"> <xsl:value-of select="$token"/> </fo:inline></xsl:when>
+ <xsl:when test="$style = 'xml_tag_symbols'"> <fo:inline color="#008080"> <xsl:value-of select="$token"/> </fo:inline></xsl:when>
+ <xsl:when test="$style = 'xml_comment'"> <fo:inline color="#3F5FBF"> <xsl:value-of select="$token"/> </fo:inline></xsl:when>
+ <xsl:when test="$style = 'xml_attribute_value'"> <fo:inline color="#2A00FF"> <xsl:value-of select="$token"/> </fo:inline></xsl:when>
+ <xsl:when test="$style = 'xml_attribute_name'"> <fo:inline color="#7F007F" font-weight="bold"> <xsl:value-of select="$token"/> </fo:inline></xsl:when>
+ <xsl:when test="$style = 'xml_processing_instruction'"> <fo:inline color="#000000" font-weight="bold" font-style="italic"> <xsl:value-of select="$token"/> </fo:inline></xsl:when>
+ <xsl:when test="$style = 'xml_tag_name'"> <fo:inline color="#3F7F7F"> <xsl:value-of select="$token"/> </fo:inline></xsl:when>
+ <xsl:when test="$style = 'xml_rife_tag'"> <fo:inline color="#000000"> <xsl:value-of select="$token"/> </fo:inline></xsl:when>
+ <xsl:when test="$style = 'xml_rife_name'"> <fo:inline color="#008CCA"> <xsl:value-of select="$token"/> </fo:inline></xsl:when>
<xsl:otherwise> <fo:inline color="black"> <xsl:value-of select="$token"/> </fo:inline></xsl:otherwise>
</xsl:choose>
More information about the jboss-cvs-commits
mailing list