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

Getting all the values between empty elements

Subject: Getting all the values between empty elements
From: "Kyle Partridge" <kpartridge@xxxxxxxxxxxx>
Date: Mon, 5 Jan 2004 15:17:35 -0500
all about values
Hi All,

I have one final XPath-related question.

If I have a series of sibling elements like <a/>, below:

<p>
	<a/>One or two <b>items</b><a/>or <i>another</i>, I dare
say<a/><c val="#0f0">a third</c>, do you think?<br/>
</p>

how can I get at "everything between one a and the next a"?

Right now, I am formatting by matching on <br/> and looping backwards
(this is greatly simplified).

<xsl:template match="br">

	<xsl:for-each select="preceding-sibling::a">

		<xsl:value-of select="preceding-sibling::text()[1]"/>	
								
	</xsl:for-each>
			
</xsl:template>	

But, of course, I've run into the problem that what is in-between <a/>s,
could contain elements that would call for further application of
templates - it might not be text-alone.

This is my last question on this particular problem.  Thank you very
much, everyone who has helped me thus far. I hope eventually I will
progress to a point where I can say something that is of help to someone
else.

KP


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


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.