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

RE: following-sibling question

Subject: RE: following-sibling question
From: "Michael Kay" <michael.h.kay@xxxxxxxxxxxx>
Date: Thu, 5 Dec 2002 10:09:19 -0000
following sibling in xml
Your "important" elements are not siblings of each other, so you can't
use the following-sibling axis to locate them. Use the "following" axis,
or a more specific path expression such as 

../../following-sibling::document[1]/filtered-text/important

Michael Kay
Software AG
home: Michael.H.Kay@xxxxxxxxxxxx
work: Michael.Kay@xxxxxxxxxxxxxx 

> -----Original Message-----
> From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx 
> [mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of 
> Mani Malarvannan
> Sent: 04 December 2002 21:29
> To: XSL-List@xxxxxxxxxxxxxxxxxxxxxx
> Subject:  following-sibling question
> 
> 
> Hi,
> I've following XSL and XML, when I apply the XSL to the XML 
> I'm getting 
> the following output
> 
> Test 1Test 1Test 2
> 
> but I need the output to be Test 1Test 2
> 
> It shoud remove the same values that comes within the <important> 
> tag while printing it.
> 
> <?xml version="1.0" encoding="iso-8859-1"?>
> 
> <xsl:stylesheet
>     version="1.0"
>     xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
> 
> 
> 
> <xsl:output
>     method="html"
>     doctype-public="-//W3C//DTD HTML 4.0 Transitional//EN"
>     encoding="iso-8859-1"
>     indent="no" />
> 
> 
> XSL-file
> <xsl:template match="document-list" >
>   <xsl:for-each select="document/filtered-text/important[not(. = 
> following-sibling::important[1])]">
> 
>    <xsl:value-of select="."/>
>   </xsl:for-each>
> 
> </xsl:template>
> 
> 
> XML-file
> <document-list>
> <document>
> <filtered-text>
> <important>Test 1</important>
> </filtered-text>
> <word>
> <p>
> <WORD>word 1</WORD>
> </p>
> </word>
> </document>
> <document>
> <filtered-text>
> <important>Test 1</important>
> </filtered-text>
> <word>
> <p>
> <WORD>word 11</WORD>
> </p>
> </word>
> </document>
> <document>
> <filtered-text>
> <important>Test 2</important>
> </filtered-text>
> <word>
> <p>
> <WORD>word 11</WORD>
> </p>
> </word>
> </document>
> </document-list>
> </xsl:stylesheet>
> 
> Thanks for the help
> 
> -Mani
> 
> 
> 
> 
> 
> 
> 
>  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.