You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-users@xalan.apache.org by Brad Cox <bc...@virtualschool.edu> on 2002/02/02 23:50:24 UTC

Xalan extensions?

Could someone please help? I've struggled with this for ages but 
keep getting lost in the weedy syntax.

I need to pass a java instance, task, which is an instance of 
edu.virtualschool.jcms.model.Task, to an xalan xml extension.

I think this much is probably ok but even there I'm not sure:

<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
	xmlns:java="http://xml.apache.org/xslt/java"
	exclude-result-prefixes="java">

<xsl:output method="html"/>
<xsl:param name="task"></xsl:param>

<xsl:template match="/task">
<xsl:apply-templates select="page"/>
</xsl:template>

Here's where I really lose it. I need to call the addPage method 
of the instance that
I passed in, with the ident attribute as one argument and 
everything between the
<page>...</page> delimiters as the second argument. These are 
both of type String.
I've drafted this much but I've no confidence its even close:

<xsl:template match="page">
<xsl:value-of select="java:addPage(
	<xsl:param>page</xsl:param>,
	<xsl:value-of select="@ident"/>,
	<xsl:apply-templates select="*"/>)"/>
</xsl:template>

Could someone please help? Thanks!

<xsl:template match="*">
<xsl:copy-of select="."/>
</xsl:template>

</xsl:stylesheet>