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

RE: selecting all text between two nodes

Subject: RE: selecting all text between two nodes
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Wed, 7 Sep 2005 14:16:09 +0100
fd 213
In 2.0:

xsl:template match="hyperlink-start"
  xsl:variable name="end" select="following-sibling::hyperlink-end"
  xsl:value-of select="following-sibling::text()[. << $end]"

In 1.0 you can use sibling recursion (call a recursive template to process
each following sibling in turn, terminating when you get to the hyperlink
end).

Michael Kay
http://www.saxonica.com/ 
   

> -----Original Message-----
> From: Lynn Alford [mailto:lynn.alford@xxxxxxxxxx] 
> Sent: 07 September 2005 06:11
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject:  selecting all text between two nodes
> 
> I'm looking at transforming some xml  that can include 
> linking information as
> 
>   <tx.p style="FD108">Lorem ipsum dolor <tx.hyperlink 
> id="FD144" end="FD145">
>              <locator_url 
> file_name="/courses/handbooks/2005/150_admission.html" 
> host_name="www.jcu.edu.au" protocol="http"/>
>              <locator_bookmark bookmark_name="title_31161"/>
>            </tx.hyperlink>
>            <tx.r style="FD113">penatibus et magnis </tx.r>
>            <tx.hyperlink_end id="FD145" begin="FD144"/>
> dis parturient montes, nascetur ridiculus mus.
>   </tx.p>
> 
> 
>          <tx.r style="FD206">
>                      <tx.hyperlink id="FD213" end="FD214">
>                        <locator_url 
> file_name="/app/contact/index.cfm" 
> host_name="www.jcu.edu.au" protocol="http"/>
>                      </tx.hyperlink>
>                    </tx.r>
>                    <tx.r style="FD207">Student Administration 
> (8781)<tx.hyperlink_end id="FD214" begin="FD213"/>
>                    </tx.r>
> 
> 
> to be transformed to
> 
> <ulink 
> url="http://www.jcu.edu.au/courses/handbooks/2005/150_admissio
> n.html#title_31161">
> penatibus et magnis </ulink>
> 
> <ulink url="http:www.jcu.edu.au//app/contact/index.cfm" 
> id="FD213">Student 
> Administration (8781) </ulink>
> 
> which means I want to open a ulink - copy all text that 
> appears between the 
> <tx.hyperlink> and the <tx.hyperlink_end> then close the ulink.
> 
> 
> 
> I can get as far as
> 
> <ulink url="http:www.jcu.edu.au/app/contact/index.cfm" id="FD213">
> 
>                      </ulink>
> 
>                    Student Administration (8781)<ulink_end/>
> 
> But that really isn't very good.
> 
> 
> 
> Lynn Alford                             Tel     (07) 47 81 6256
> ITR                                     Email:  imla@xxxxxxxxxx
> JCU QLD 4811 Australia          ICQ: 64096907
> MSN: nicarra60@xxxxxxxxxxx              Y!: nicarra60

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.