[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Walking through text with embedded tags
At 2004-05-18 15:48 -0700, Bruce Kyle \(Volt\) wrote:
I'm trying to walk through nodes that are surrounded by text. An unknown number of nodes can be embedded. This is called "mixed content". <test> <c>This is a <a cref="test" /> of the emergency <x>broadcast</x> system.</c> <d>this is not supported</d> </test> You didn't think to insert it for the processing of <c> and letting the built-in template rule handle to addition of the text of <c> to the result tree: <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>
What am I missing? The concept of built-in templates for the handling of nodes for which you have no template rule ... and there exists one for every kind of node ... thus your text nodes will get handled without you doing anything special in your stylesheet. I hope this helps. .................... Ken -- 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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|