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

RE: Only selectingn first occurance?

Subject: RE: Only selectingn first occurance?
From: "Scott Trenda" <Scott.Trenda@xxxxxxxx>
Date: Thu, 18 Oct 2007 14:44:23 -0500
RE:  Only selectingn first occurance?
<xsl:variable name="builds" select="/project/target[contains(@name,
'_stuff')]/@depends"/>
<xsl:variable name="builds-string">
  <xsl:for-each select="$builds">
    <xsl:value-of select="."/>
    <xsl:if test="position != last()" xml:space="preserve"> </xsl:if>
  </xsl:for-each>
</xsl:variable>

~ Scott


-----Original Message-----
From: Dan Vint [mailto:dvint@xxxxxxxxx]
Sent: Thursday, October 18, 2007 2:37 PM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: Re:  Only selectingn first occurance?

I don't think this is the problem, or maybe it is but manifested in a
different way. What I'm trying to do is get one long string of several
different types of targets, so my real variable is defined like this:

<xsl:variable name="builds"
select="concat(/project/target[@name='all']/@depends,

' ', /project/target[@name='books']/@depends,

' ', /project/target[contains(@name, 'stuff')]/@depends,
' ', /project/target[@name='plugins']/@depends,

' ', /project/target[@name='help']/@depends

)"/>

When I use the value of this builds variable, I get a list of something
from all and the one item from the contains. Maybe I need to switch to a

key and use that instead?

..dan

------------------------------------------------------------------------
---
Danny Vint

Specializing in Panoramic Images of California and the West
http://www.dvint.com

Voice:510:522-4703
FAX: 801-749-3229

On Thu, 18 Oct 2007, Steve wrote:

> Try looping through your variable to see if it really only contains 1
node?
>
> On 10/18/07, Joe Fawcett <joefawcett@xxxxxxxxxxx> wrote:
>> ----- Original Message -----
>> From: "Dan Vint" <dvint@xxxxxxxxx>
>> To: <xsl-list@xxxxxxxxxxxxxxxxxxxxxx>
>> Sent: Thursday, October 18, 2007 7:30 PM
>> Subject:  Only selectingn first occurance?
>>
>>
>>> I have the following variable defintion:
>>> <xsl:variable name="builds"
>>>  select="/project/target[contains(@name, '_stuff')]/@depends"/>
>>>
>>> If I use this in Stylus studio and use the XPath evaluator, the
XPath
>>> gives me all instances of the Ant targets where the name attribute
has
>>> _stuff as part of the name. But when I use this this as part of my
>>> stylesheet, I only get the first occurance.
>>>
>>> Here is the contents of the variable:
>>>
>>> "common92, confgwiz92, smart_update92, tempbuild92"
>>>
>>> And this is the XPath evaluator window results, it shows 4 hits on
this
>>> path with results of
>>>
>>> common92 configwiz92 smart_update92 tempbuild92
>>>
>>> common100 common100_smart_update
>>>
>>> wli92 wlibc92 adminhelp92 ...
>>>
>>> wli102-alint wli102 wlibc102 ....
>>>
>>> How do I change the <xsl:variable> to find the content of all the
targets
>>> and not just the first one?
>>>
>>> ..dan
>>>
>>>
------------------------------------------------------------------------
---
>>> Danny Vint
>>>
>>> Specializing in Panoramic Images of California and the West
>>> http://www.dvint.com
>>>
>>
>> Why do you think it's only selecting the first attribute?
>> If you use xsl:value-of to show the result it will only show the
first node
>> in the variable.
>> Show how you are using $builds.
>>
>> Joe
>> http://joe.fawcett.name

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.