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

SV: Removing tags automatically efter xsl transformati

Subject: SV: Removing tags automatically efter xsl transformation!
From: Klosa Uwe <Uwe.Klosa@xxxxxxxx>
Date: Tue, 7 Aug 2001 15:27:03 +0200
xslt remove tags
Thanks Alexander,

 I want 1

/Uwe

> -----Ursprungligt meddelande-----
> Fran: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> [mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx]For 
> gutman@xxxxxxxxxxxxxxx
> Skickat: den 7 augusti 2001 14:43
> Till: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Amne: Re:  Removing tags automatically efter xsl transformation!
> 
> 
> Hello.
> 
> Klosa Uwe wrote:
> > I want to remove tags like <tag/> (without any child and 
> string-length 
> of
> > zero) from my output. I'm transforming xml-files to 
> different formats. 
> In
> > some I don't want to have "empty" tags.
> 
> Do you want
> 
>   (1) to remove all elements with empty content or
>   (2) to prevent their appearance in the output?
> 
> These are different wiches.
> For instance, what you want to do with the following input?
> 
>   <one>
>     <two>
>       <three/>
>     </two>
>   <one/>
> 
> If you want (1) then the output will be
> 
>   <one>
>     <two/>
>   <one/>
> 
> But if you want (2), I guess, the output will be empty.
> In the case of (1), here is a solution:
> 
>   <xsl:template match="*">
>     <xsl:if test="node()">
>       <xsl:copy>
>         <xsl:copy-of select="@*"/>
>         <xsl:apply-templates select="node()"/>
>       </xsl:copy>
>     </xsl:if>
>   </xsl:template>
> 
> As for (2), I will start thinking
> only after you say you really want it. :-)
> 
> -- 
> Alexander E. Gutman
> 
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
> 

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


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.