srikanth,
At 11:14 AM 7/19/01, you wrote:
Hi,
How do i read the value of the child element and print
the value of the parent element
xml:
<a>1
<b>2
<c>3</c>
<d>4</d>
</b>
</a>
I need to check for the value of [c=3] and print 2
You don't actually want the value of the 'b' element, which is '234' (the
concatenation of its text node descendants. So try something like
<xsl:template match="c[.='3']">
<xsl:value-of select="../text()"/>
</xsl:template>
which will get you the value of the first text node child of c's parent (b).
Cheers,
Wendell
======================================================================
Wendell Piez mailto:wapiez@xxxxxxxxxxxxxxxx
Mulberry Technologies, Inc. http://www.mulberrytech.com
17 West Jefferson Street Direct Phone: 301/315-9635
Suite 207 Phone: 301/315-9631
Rockville, MD 20850 Fax: 301/315-8285
----------------------------------------------------------------------
Mulberry Technologies: A Consultancy Specializing in SGML and XML
======================================================================
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
| Current Thread |
- parent -child
- srikanth - Thu, 19 Jul 2001 11:18:55 -0400 (EDT)
- Wendell Piez - Thu, 19 Jul 2001 12:23:09 -0400 (EDT) <=
- Jeni Tennison - Thu, 19 Jul 2001 13:06:20 -0400 (EDT)
- <Possible follow-ups>
- Heather Lindsay - Thu, 19 Jul 2001 11:42:53 -0400 (EDT)
- srikanth - Thu, 19 Jul 2001 13:53:24 -0400 (EDT)
|
|