Subject: Re: [xsl] template matching everywhere From: Wendell Piez <wapiez@xxxxxxxxxxxxxxxx> Date: Thu, 04 Mar 2004 18:39:02 -0500 |
I would like to write a template that match a particular element but this element could be located anywhere
<ROOT> <NODE> maybe some text here <TOBEMATCHED> </TOBEMATCHED> maybe some text here </NODE> <NODE> <SUBNODE> maybe some text here <TOBEMATCHED> </TOBEMATCHED> maybe some text here </SUBNODE> <SUBNODE> <SUBSUBNODE> maybe some text here <TOBEMATCHED> </TOBEMATCHED> maybe some text here </SUBSUBNODE> </SUBNODE> </NODE> </ROOT>
I would like to write a template that allow me to automatically translate the TOBEMATCHED element while processing his parent.
<xsl:template match="TOBEMATCHED"> <!-- this works wherever TOBEMATCHED occurs, assuming the node is selected for processing at all --> <output> <xsl:apply-templates/> </output> </xsl:template>
For example suppose you have to proceed an HTML document and you want to replace each <b> tag with an <em> tag and did other work on other it may help you understand what I want to do.
<xsl:template match="b"> <em> <xsl:apply-templates/> </em> </xsl:template>
Cheers, Wendell
====================================================================== Wendell Piez mailto:wapiez@xxxxxxxxxxxxxxxx Mulberry Technologies, Inc. http://www.mulberrytech.com 17 West Jefferson Street Direct Phone: 301/315-9635 Suite 207 Phone: 301/315-9631 Rockville, MD 20850 Fax: 301/315-8285 ---------------------------------------------------------------------- Mulberry Technologies: A Consultancy Specializing in SGML and XML ======================================================================
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
[xsl] template matching everywhere, jf | Thread | Re: [xsl] template matching everywh, jf |
RE: [xsl] does java fully implement, Michael Kay | Date | [xsl] concat - node set or a string, Markus Hanel |
Month |