[xsl] using xsl:value-of but omitting some children - possible?

Subject: [xsl] using xsl:value-of but omitting some children - possible?
From: "Ke'tszeri Csaba" <csaba@xxxxxxxxxxx>
Date: Thu, 27 Jan 2005 15:54:48 +0100
Hello!

I have problems with the following fragment:

<somewheredeep>
   <chaptertitle>
      our title
      <part>
            has some parts
      </part>
      <ugly>
            some ugly things here
      </ugly>
   </chaptertitle>
</somewheredeep>

I have the folloowing structure of templates

<xsl:temaplate match="somewheredeep">
    <xsl:variable name="chaptitle">
       <xsl:call-template name="getchaptitle"/>
    </xsl:variable>
    <!-- I use $chaptitle several times here -->
</xsl:template>

<xsl:template name="getchaptitle">
   <xsl:value-of select="chaptertitle">
</xsl:template>

I have to do different things (like cutting at the
first space after 30 chars or something similar)
with the text content of the chaptertitle.

I'd like to get the content of the <chaptertitle>
and the <part> but not the <ugly>.

Can I get rid of the ugly somehow?
The only solution I've found so far is that to get the content of the
ugly and replace it with an empty string, but considering that the
there could be another unnecessary tags, it would be a slow and ugly :)
solution.


Thank you for any advice!


Csaba

Current Thread