Hi all--

I've been trying to find a way to choose a stylesheet based on some arbitrary structures within my source XML. I came across AxAddDynamicProcessor in the documentation, and it appears to be what I need.

However, in Apache::AxKit::ConfigReader->GetMatchingProcessors it appears that styles specified in AxAddDynamicProcessor handlers are added to the *end* of the pipeline, after any "normal" AxAddXXXProcessor styles. This behavior doesn't make sense to me (shouldn't a dynamic processor be just like any other processor?), but I'm not all that familiar with the architecture, so my question is: is this a bug or an intentional design?

I've included a minimal testcase setup below that shows what I'm talking about. I'm happy to provide more information if needed. Thanks for your time!

--Jason



=== .htaccess ===

<Files test.xml>
    AxAddProcessor text/xsl test1.xsl
    AxAddDynamicProcessor My::DynamicProcessor
    AxAddProcessor text/xsl test3.xsl
</Files>

=== My/DynamicProcessor.pm ===

package My::DynamicProcessor;
sub handler {
    my ($provider, $media, $style, $doctype, $dtd, $root) = @_;
    return {type => 'text/xsl', href => 'test2.xsl', title => $style};
}
1;


=== test.xml ===


<?xml version="1.0"?>
<doc />


=== test1.xsl ===


<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>
    <xsl:template match="/">
        <doc>
            <xsl:value-of select="." />
            <xsl:text>1</xsl:text>
        </doc>
    </xsl:template>
</xsl:stylesheet>


=== test2.xsl ===


<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>
    <xsl:template match="/">
        <doc>
            <xsl:value-of select="." />
            <xsl:text>2</xsl:text>
        </doc>
    </xsl:template>
</xsl:stylesheet>


=== test3.xsl ===


<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>
    <xsl:template match="/">
        <doc>
            <xsl:value-of select="." />
            <xsl:text>3</xsl:text>
        </doc>
    </xsl:template>
</xsl:stylesheet>


=== Expected Result: ===


<doc>123</doc>

=== Actual Result: ===

<doc>132</doc>




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



Reply via email to