Subject: Re: [xsl] [Fwd: Text from mixed content but not all embedded elements] From: Andy Black <andy_black@xxxxxxx> Date: Wed, 11 Mar 2009 14:58:06 -0700 |
Use the standard XSLT coding pattern: for each element, write a template rule that recurses downwards to process its children. Except when you don't want to process the children:
<xsl:template match="secTitle"> <xsl:apply-templates/> </xsl:template>
<xsl:template match="endNote"/>
In fact, the only rule you need explicitly is the one for endNote; for all the other nodes, the default built-in template rule does the right thing.
Michael Kay
http://www.saxonica.com/
-----Original Message-----
From: Andy Black [mailto:andy_black@xxxxxxx] Sent: 11 March 2009 21:25
To: XSL List
Subject: [xsl] [Fwd: Text from mixed content but not all embedded elements]
I have a situation with an XML portion like the following:
<secTitle>Complements of <langData lang="lVernacular">le'e</langData>
and other arguments<endnote id="nhabby">
<p>We wish to thank those who helped us.</p> </endnote> </secTitle>
Using XSLT 1.0, I want to output the text of all but what is in the embedded <endnote> element. That is, the text output I want is
Complements of le'e and other arguments
I know that if I use <xsl:copy-of select="text()"/> I can get all of the text nodes, but I want to limit it to all but what is within the <endnote> element.
Is there a way to do this in XSLT 1.0?
Thanks,
--Andy
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: [xsl] [Fwd: Text from mixed con, Michael Kay | Thread | [xsl] Fwd: xslt:image resizing, Plew |
RE: [xsl] [Fwd: Text from mixed con, Michael Kay | Date | Re: [xsl] include multiple utility , frank johnson |
Month |