apply-templates

Two concepts from XSLT in other languages: apply-templates and xpath

Background: Having given up on the practical daily use of XSLT as a part of my programming toolkit, I was wondering if there were any implementations in other languages of the (only) two things I miss about that tool: the ability to traverse data structures using "path" style statments via xpath the ability to traverse template transfo...

Add soap header - update a node - copy document

I'm trying to add Soap headers to my document and update the first RS node with <Rs xmlns="http://tempuri.org/schemas"&gt; all while copying the remainder of the document nodes. In my real example i'll have more nodes within RS parent node so i'm looking for a solution with a deep copy of some sort. <-- this is the data which needs...

XSLT: Apply templates with conditional parameters?

I'd like to apply a template with different parameters based on the result of a conditional. Something like this: <xsl:choose> <xsl:when test="@attribute1"> <xsl:apply-templates select='.' mode='custom_template'> <xsl:with-param name="attribute_name" tunnel="yes">Attribute no. 1</xsl:with-param> <xsl:...

How do I apply templates to each selected node in a for-each?

I know I'm missing something here. In the XSLT transformation below, the actual result doesn't match the desired result. Inside the for-each, I want to apply the match="track" template to each selected track element. If I've understood XSLT properly, with the current setup only child nodes of each selected track element are matched agai...

XSLT / Xalan : calling apply-templates from within a Java extension

I am using Xalan and Java for extending a stylesheet. (Similar example to what I am doing there : Dictionary example) I struggle to make my tag do an <xsl:apply-templates/>. I wish to have this : <xsl:template match="sometag"> <my-java:tag> <xsl:apply-tempates/> </my-java:tag> </xsl:template> My java class containing...

Optimisation <xsl:apply-templates/> for a set of tags.

How it is possible to reduce this record? <xsl:template match="BR"> <br/> </xsl:template> <xsl:template match="B"> <strong><xsl:apply-templates /></strong> </xsl:template> <xsl:template match="STRONG"> <strong><xsl:apply-templates /></strong> </xsl:template> <xsl:template match="I"> <em><xsl:apply-templates /></em> </...

XSL using apply templates and match instead of call template

I am trying to make the transition from using call-template to using applay templates and match but i'm not getting any data displayed only what is between the volunteer tags. When i use call template it works fine but it was suggested that i use applay-templates and match and not it doesn't work Any ideas how to make this work? I can ...

XSL apply templates not working...could be XPath error

I have converted mny stylesheet to use apply templates instead of call templates and it worked fine for my other styesheet, which was more complicated, but this one doesn't seem to work even thought it is a much simpler template. All that it outputs is the sex node and the userlevel node. I think it has to do with my Xpath. All i want...