xsl-list
[Top] [All Lists]

RE: Forbidden with several xsl:attribute from xsl:apply-templates? - test and results

2003-07-01 15:22:10
Did you tell us what processor you're using?


Xalan 2.4.1 with FOP

Many of us XSLT programmer-types have two (or three or four) 
different 
processors on our system to try when this kind of thing 
happens. If the 
stylesheet breaks in another processor, chances are the bug 
is your own.


Below is a more complete sample. 

This gives a correct output, all attributes included, when tested in XML
Spy version 4.1, which I think uses MSXML(?) by default.

So either the error is in my code or in Xalan. But I've learned by time
that you shouldn't be too quick too blame other peoples code. Although I
have been testing it extensively to try to find the troublesome spot.
But I won't go into details about that here.

The specific thing that I'm doing is that the "mode" templates are
output through a home cooked transformation of CSS files into a separate
"styling" xslt file that then includes the main stylesheet. To achieve
integration with the css style profile of a web site.

But to conclude this: The code below seems to be valid xslt, so the
error is elsewhere. Thanks for the input.

----------------------------------------------------------------
<!--Test XSLT - NOT a complete xsl:fo output, I know-->
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" 
        xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; 
        xmlns:fo="http://www.w3.org/1999/XSL/Format";>
        <xsl:output method="xml" version="1.0" encoding="UTF-8"
indent="yes"/>
        
 <xsl:template match="p">
    <fo:block>
      <xsl:apply-templates select="." mode="elementselection"/>
      <xsl:apply-templates select="." mode="classselection"/>
      <xsl:apply-templates/>
    </fo:block>
 </xsl:template>        
        
        
 <xsl:template match="p" mode="elementselection">       
    <xsl:attribute name="font-family">sans-serif</xsl:attribute>
    <xsl:attribute name="font-size">20pt</xsl:attribute>
 </xsl:template>
 
 <xsl:template match="*[(_at_)class = 'leadtext']" mode="classselection">
    <xsl:attribute name="border-bottom-color">sans-serif</xsl:attribute>
    <xsl:attribute name="border-bottom-width">0.5pt</xsl:attribute>
 </xsl:template>

</xsl:stylesheet>


<!--Test XML -->
<?xml version="1.0" encoding="UTF-8"?>
<body>
Test
        <!-- This is the specific node -->
        <p class="leadtext">Test2</p>
</body>



 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list



<Prev in Thread] Current Thread [Next in Thread>