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

Re: not having all the children of an element in the o

Subject: Re: not having all the children of an element in the output
From: "Vasu Chakkera" <vasucv@xxxxxxxxxxx>
Date: Tue, 30 Dec 2003 20:19:16 -0800
xsl nodes not having children
Hi Toma,
Something like this should work

<xsl:template match="node()|@*">
   <xsl:copy>
   <xsl:apply-templates select="@*"/>
   <xsl:apply-templates/>
   </xsl:copy>
 </xsl:template>
<xsl:template match="term"/>
</xsl:stylesheet>

 This is doing Identity transformation and not telling what to do with the
<term> node..
So you copy everything except the term node.
Do the same to the <note> node If you want the note node to be  left..
hope this helps
Vasu

----- Original Message ----- 
From: "Toma Tasovac" <ttasovac@xxxxxxxxxxxxx>
To: <XSL-List@xxxxxxxxxxxxxxxxxxxxxx>
Sent: Tuesday, December 30, 2003 4:04 AM
Subject:  not having all the children of an element in the output


> Hi!  This is a pretty basic question, so I hope you won't mind me
> posting it here.
>
> I have an XML doc which contains certain marked terms and has notes
> attached next to them, like this:
>
> <p>some text <term>some phrase</term><note><term>basic form of the
> phrase><gloss>explanation of the phrase</gloss>some text.</p>
>
> In other words, <p> element can have two children: <term> marking the
> phrase as it appears in the text and being part of the text itslef, and
> <note> which attaches a note explaining the term in some detail.
>
> I am having problems designing an xsl template which will output:
>
> <p>some text<term>some phrase</term>some text</p>
>
> i.e. which will include only one of the two possible children
> elements... Everything I do outputs either both <term> and <note> OR
> neither one of them... What's the trick?
>
> Many thanks in advance,
>
> Toma
>
>
>  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.