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

Re: Could not select the text() of both parent & child

Subject: Re: Could not select the text() of both parent & child nodes simultaneously
From: Jack Bush <netbeansfan@xxxxxxxxxxxx>
Date: Fri, 18 Jun 2010 06:07:18 -0700 (PDT)
Re:  Could not select the text() of both parent & child
Hi Steve,

Yes, finally. This is perfect! Being able to reference the sibling
node without being locked by the node itself.

Below is what I have ended up
with:

<xsl:template match="ns:p[ns:strong='World Cup Competition:']">
 
<xsl:for-each select="ns:a">
      <team><xsl:value-of
select="concat(./normalize-space(),./following-sibling::text()[normalize-spac
e()])"/></team>
  </xsl:for-each> 
</xsl:template> 

Thank you very much for
getting this right at last. Also very much appreciates David Carlisle & Michal
Kay for your invaluable guidances.

Jack


----- Original Message ----
From:
"steve.majewski@xxxxxxxxx" <steve.majewski@xxxxxxxxx>
To:
xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Sent: Fri, 18 June, 2010 12:53:44 PM
Subject:
Re:  Could not select the text() of both parent & child nodes
simultaneously


On Jun 17, 2010, at 9:01 PM, Jack Bush wrote:

> Hi Steve,
>
> The desire output would be:
>
>  <team>Brasil (30 goals)<team>
> 
<team>Argentina (25 goals)<team>
>  <team>Germany (22 goals)<team>
> 
<team>USA (15 goals)<team>
>
> Thanks in advance,
>
> Jack
>
>


Maybe
something like:


    <xsl:template match="/" >
        <xsl:for-each
select="/html:html/html:body//html:p/html:a" >
            <team>
           
    <xsl:value-of select="concat(./text(),' ',./following-
sibling::text()[1])" />
            </team>
        </xsl:for-each>
   
</xsl:template>


( i.e. for each <a>, concatenate the text of a, a space, and
the next  
following text node.  )


> ----- Original Message ----
> From:
"steve.majewski@xxxxxxxxx" <steve.majewski@xxxxxxxxx>
> To:
xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Sent: Fri, 18 June, 2010 12:41:58 AM
>
Subject: Re:  Could not select the text() of both parent &  
> child
nodes simultaneously
>
>
> On Jun 17, 2010, at 10:23 AM, Jack Bush wrote:
>
>>
( A )<xsl:template match="ns:p[ns:strong='World Cup Competition:']">
>>       
<xsl:for-each select="text()|ns:a">
>>          <team><xsl:value-of
select="normalize-space()"/></team>
>>        </xsl:for-each>
>>     
</xsl:template>
>>  Output
>> <team>Brasil<team>
>> <team>(30 goals)<team>
>>
<team>Argentina<team>
>> <team>(25 goals)<team>
>> <team>Germany<team>
>>
<team>(22 goals)<team>
>> <team>USA<team>
>> <team>(15 goals)<team>
>
> Wnat
do you want the output to look like ?
>
>
>
>
--~------------------------------------------------------------------
>
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
> To
unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
> or e-mail:
<mailto:xsl-list-unsubscribe@xxxxxxxxxxxxxxxxxxxxxx>
> --~--
>
>
>
>
>
>
--~------------------------------------------------------------------
>
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
> To
unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
> or e-mail:
<mailto:xsl-list-unsubscribe@xxxxxxxxxxxxxxxxxxxxxx>
> --~--

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.