Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XSLT
|
XSLT General questions and answers about XSLT. For issues strictly specific to the book XSLT 1.1 Programmers Reference, please post to that forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XSLT section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 7th, 2006, 05:31 AM
Authorized User
 
Join Date: Jun 2006
Posts: 23
Thanks: 0
Thanked 0 Times in 0 Posts
Default duplicate problem

Hi,

i have the following source :

<block>
 <property name="BlockType" value="Reference />
 ....
 <property name="SourceBlock" value="fonctions/SubSystem1" />
</block>

<block>
 <property name="BlockType" value="Reference />
 ....
 <property name="SourceBlock" value="fonctions/SubSystem2" />
</block>


The interesting thing here is the 'fonctions' word.
i'd like to produce something like : 'use fonctions;'

but with the following code

<xsl:for-each select="block[property[@name='BlockType' and @value='Reference']]">
      <xsl:text>use </xsl:text>
      <xsl:value-of select="substring-before(property[@name='SourceBlock']/@value,'/')" />
    </xsl:for-each>

i have the 'use fonctions;' twice. i'd like to have it once per SourceBlock value (before the '/').

Any ideas ? i tried with grouping but i don't have enough experience.

Thanks

 
Old August 7th, 2006, 11:55 AM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

You're right that this is a grouping problem. First thing is to establish whether you're using 1.0 or 2.0.

Try to tackle some simpler grouping problems first, and build up to this one. For example, see if you can do it in the case where "fonctions" is a separate attribute on its own.

Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference





Similar Threads
Thread Thread Starter Forum Replies Last Post
duplicate records vanitha SQL Server 2000 4 June 2nd, 2007 04:35 PM
duplicate emails flchen Classic ASP Components 2 February 14th, 2007 09:02 AM
problem with duplicate assemblies chrisclark1978 C# 2005 1 November 8th, 2006 10:59 AM
Duplicate ID? johno BOOK: ASP.NET Website Programming Problem-Design-Solution 2 July 10th, 2005 11:24 PM
how to duplicate a javascript gilgalbiblewheel Javascript How-To 2 March 3rd, 2005 02:03 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.