Forums Register Login
Question on XSL
Here is example from zvon

<xsl:stylesheet version = '1.0'
<xsl:template match="employee">
<xsl:value-of select="."/>
<xsl:template match="surname">
<xsl:value-of select="."/>


The result is "Joe Smith". My question is: the process just processes the first template, or processes both, but the second produces zero output? if not processes the second, comparing the previous example, it should process second??
Thanks for any reply!!
XSLT has several default template rules. One of them is for element and root nodes -
<xsl:template match="*|/">
This rule ensures that the source element and then employee are processed.
For the employee element we have a rule that outputs the data. This template doesn't call templates for its descendants (<xsl:apply-templates/>), so the template surname never gets called.
Thanks for your reply, Dan.
You totally ruined the moon. You're gonna hafta pay for that you know. This tiny ad agrees:
Download Free Java APIs to Work with Office Files and PDF

This thread has been viewed 663 times.

All times above are in ranch (not your local) time.
The current ranch time is
Dec 13, 2018 05:58:17.