RE: How to xsl:apply-templates while xsl:copy-of?

Alain Gilbert <[email protected]>
Newsgroups gmane.text.xml.xalan.java.user
Message-ID <[email protected]>
Thanks Tomas,

The print.xsl transformation is generated from another source and the addInlineText value parameter may contain arbitrary html content. I have simplified the print.xsl template to its bare minimum to show my problem. In general there will be many calls to addInlineText with varying values.

My intent is to use the xhtml2fo.xsl template provided by www.antennahouse.com<http://www.antennahouse.com/> to process the XHTML to FO transformation of html:* nodes.

Hopes this clarify my original post.

Alain Gilbert

________________________________
From: Tomas Studva [mailto:[email protected]]
Sent: Tuesday, September 08, 2009 11:00 AM
To: Alain Gilbert
Subject: Re: How to xsl:apply-templates while xsl:copy-of?

Hi Gilbert,
I think it is not possible to match template against a parameter. Template can match only nodes in input XML. The desired effect you can get, if the "addInlineText" template will call template "html:p" with some parameter.

<xsl:call-template name="etc">
  <xsl:param name="param1" select="$value" />
</xsl:call-template>

Apply template calls are very similiar to call-template calls.

But in general, I don't see what are you trying to achieve.

Tomas Studva
On Tue, Sep 8, 2009 at 4:30 PM, Alain Gilbert <[email protected]<mailto:[email protected]>> wrote:
Hi,

I'm using xalan-2.7.0 (the same applies to version 2.7.1) and I'd like the transform to apply-templates while copying a set of nodes from the template into the result document.

I have attached the print.xsl template. Look at line 18 of print.xsl for the template "addInlineText" declaration and at line 10 for its call. At line 21, how to apply-templates while copying the template parameter?

In other words, I'd like the template that match "html:p" to be applied when the template "addField" is called with the parameter "value" with a set of node as value.

Is it possible to do it with XSLT 1.0? I'd like to avoid a second pass to apply the html:* templates.

Thanks,
Alain Gilbert
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.