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

RE: XSL to generate required output

Subject: RE: XSL to generate required output
From: "Amrit Pal Singh" <ampsingh@xxxxxxxxx>
Date: Tue, 13 Dec 2005 17:46:38 +0530
xsl attribute in xsl fiel
Hi all,

Thanks for your replies... It worked with xsl below.

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
	<xsl:variable name="delimiter" select="'##'"/>
	<xsl:template match="/">
		<WorkSheet>
			<xsl:apply-templates select="//Table"/>
		</WorkSheet>
	</xsl:template>
	<xsl:template match="Table">
		<xsl:copy>
			<xsl:apply-templates
select="Row[Cell=$delimiter]" mode="mode1"/>
		</xsl:copy>
	</xsl:template>
	<xsl:template match="Row[Cell=$delimiter]" mode="mode1">
		<Section>
		<xsl:attribute name="name"><xsl:value-of
select="following-sibling::Row/Cell[1]"/></xsl:attribute>
			<xsl:apply-templates
select="following-sibling::*[1]" mode="mode1"/>
		</Section>
	</xsl:template>
	<xsl:template match="*" mode="mode1">
		<xsl:apply-templates select="."/>
		<xsl:if
test="not(following-sibling::*[1]/self::Row[Cell=$delimiter])">
			<xsl:apply-templates
select="following-sibling::*[1]" mode="mode1"/>
		</xsl:if>
	</xsl:template>
	<xsl:template match="@* | node()">
		<xsl:copy>
			<xsl:apply-templates select="@* | node()"/>
		</xsl:copy>
	</xsl:template>
</xsl:stylesheet>

Regards,
Amrit


-----Original Message-----
From: Ragulf Pickaxe [mailto:ragulf.pickaxe@xxxxxxxxx]
Sent: Monday, December 12, 2005 7:35 PM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: Re:  XSL to generate required output

Hi Amrit,

> Hi Mike,
..
> <xsl:variable name="poscurrent" select="position()"/>
..
> <xsl:copy-of select="following-sibling::Row[not(Cell='##')][position()

> &lt; poscurrent]"/>

I am not Michael, but...

You are here saying that you want the following siblings, that have a
position which is less than the position of the current one. This is an
expression that is always false.

The one I provieded is more in the line of the solutions found in:
http://www.dpawson.co.uk/xsl/sect2/N4486.html (first hit on the google
search that Michael Kay provided).

Regards,
Ragulf Pickaxe :-)

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.