[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: using xsl:value-of but omitting some children - p

Subject: RE: using xsl:value-of but omitting some children - possible?
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Thu, 27 Jan 2005 15:13:34 -0000
children p
You need to do a recursive apply-templates to the contents of the
chaptertitle element, copying those parts that you want and omitting the
parts you don't want.

Michael Kay
http://www.saxonica.com/ 

> -----Original Message-----
> From: Ke'tszeri Csaba [mailto:csaba@xxxxxxxxxxx] 
> Sent: 27 January 2005 14:55
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject:  using xsl:value-of but omitting some children 
> - possible?
> 
> 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

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.