xsl-list
[Top] [All Lists]

RE: Problem with nodes & subnodes

2005-07-23 07:07:03
<xsl:template match="manager">
   <xsl:value-of select="text()[1]"/>
</xsl:template>

--A


From: "Michele Patron" <michelepatron(_at_)hotmail(_dot_)com>
Reply-To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: [xsl] Problem with nodes & subnodes
Date: Sat, 23 Jul 2005 13:43:29 +0000

Dear xsl programmers,

I have the following problem: my xml is

<manager>
manager1
<employee>employee1</employee>
<employee>employee2</employee>
<firm>firm</firm>
</manager>

How can I select just the text inside the main node "manager" (which is "manager1"), without selecting employee & firm nodes?
At the moment


<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>
<xsl:output method="text" indent="yes"/>
<xsl:template match="/">
        <xsl:apply-templates select="manager"/>
</xsl:template>
<xsl:template match="manager">
        <xsl:value-of select="."/>
</xsl:template>
</xsl:stylesheet>

Clearly return me the whole text....

manager1
employee1
employee2
firm

What I want to get is just

manager1

_________________________________________________________________
Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/


--~------------------------------------------------------------------
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>