xsl-list
[Top] [All Lists]

RE: Copy all nodes

2005-06-15 00:34:49
Would it be like
<xsl:template match="/">
<xsl:apply-templates/>  
</xsl:template>
<xsl:template match="@*|node()">
    <xsl:apply-templates select="@*|node()" />
</xsl:template>
<xsl:template match="connectivity[not(*)]">
        <xsl:copy>
        <xsl:apply-templates select="@*|node()" />
        </xsl:copy>
</xsl:template>

regards,
Ranjan

--- Michael Kay <mike(_at_)saxonica(_dot_)com> wrote:

Your template is copying a node only if it has one
or more children named
Entry.

Use a standard identity template and supplement it
with the second rule:

<xsl:template match="Entry[not(*)]"/>

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

-----Original Message-----
From: Ranjan K. Baisak
[mailto:ranjanbaisak(_at_)yahoo(_dot_)com] 
Sent: 15 June 2005 07:39
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: Re: [xsl] Copy all nodes 

I forgot to mention, if any <Entry> element with
zero
child, then I dont wan to copy.

<xsl:template match="@*|node()">
  <xsl:copy>
    <xsl:if test="count(child::Entry)>0">
            <xsl:apply-templates select="@*|node()" />
    </xsl:if>
  </xsl:copy>
</xsl:template>

The above template does not work

-Ranjan

--- "Ranjan K. Baisak" <ranjanbaisak(_at_)yahoo(_dot_)com>
wrote:

Hello,
     I need a xpath expression to copy all nodes
from
source.
e.g. input: <Entry>
          <Session>2004/5</Session>
          <Department>Accounting and
Finance</Department>
  </Entry>

output:<Entry>
          <Session>2004/5</Session>
          <Department>Accounting and
Finance</Department>
  </Entry>
Can anybody tell me the xpath expression for the
same.

regards,
Ranjan


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam
protection around 
http://mail.yahoo.com 




--~------------------------------------------------------------------
XSL-List info and archive: 
http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to:
http://lists.mulberrytech.com/xsl-list/
or e-mail:

<mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--





            
__________________________________ 
Discover Yahoo! 
Find restaurants, movies, travel and more fun for
the 
weekend. Check it out! 
http://discover.yahoo.com/weekend.html 




--~------------------------------------------------------------------
XSL-List info and archive: 
http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to:
http://lists.mulberrytech.com/xsl-list/
or e-mail:
<mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--






--~------------------------------------------------------------------
XSL-List info and archive: 
http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to:
http://lists.mulberrytech.com/xsl-list/
or e-mail:
<mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--





                
__________________________________ 
Discover Yahoo! 
Have fun online with music videos, cool games, IM and more. Check it out! 
http://discover.yahoo.com/online.html

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



<Prev in Thread] Current Thread [Next in Thread>