Subject: Re: [xsl] Walking through text with embedded tags From: "G. Ken Holman" <gkholman@xxxxxxxxxxxxxxxxxxxx> Date: Wed, 19 May 2004 07:26:04 +0800 |
I'm trying to walk through nodes that are surrounded by text. An unknown number of nodes can be embedded.
<test> <c>This is a <a cref="test" /> of the emergency <x>broadcast</x> system.</c> <d>this is not supported</d> </test>
I want to output:
<doc>This is a <b>test</b> of the emergency <i>broadcast</i> system</doc>
I tired this, but I am missing my <a> and <x> nodes on output. I tried inserting <apply-templates> everyplace I could think of inside the template matching c, but I am missing some trick.
<xsl:template match="c"> <xsl:for-each select="text()"> <xsl:value-of select="."/> </xsl:for-each> <!-- my confusion: where does apply-templates go? --> </xsl:template>
<xsl:template match="c"> <xsl:apply-templates/> </xsl:template>
What am I missing?
-- Public courses: Spring 2004 world tour of hands-on XSL instruction Next: 3-day XSLT/XPath; 2-day XSL-FO - Birmingham, UK June 14,2004
World-wide on-site corporate, govt. & user group XML/XSL training. G. Ken Holman mailto:gkholman@xxxxxxxxxxxxxxxxxxxx Crane Softwrights Ltd. http://www.CraneSoftwrights.com/s/ Box 266, Kars, Ontario CANADA K0A-2E0 +1(613)489-0999 (F:-0995) Male Breast Cancer Awareness http://www.CraneSoftwrights.com/s/bc Legal business disclaimers: http://www.CraneSoftwrights.com/legal
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
[xsl] Walking through text with emb, Bruce Kyle \(Volt\) | Thread | [xsl] Is it possible to get " , Steven Reddie |
Re: [xsl] problem with one xml for , Steve Fitzpatrick | Date | [xsl] Is it possible to get " , Steven Reddie |
Month |