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

Retrieving info between two tags.

Subject: Retrieving info between two tags.
From: "Maxine Pensyl-Johnson" <Maxine.Pensyl-Johnson@xxxxxxx>
Date: Thu, 30 Aug 2007 08:06:05 -0700
 Retrieving info between two tags.
Greetings everyone,

I have a situation where I need to define separate out puts for each
para tag within the step1 tag. So I've created a <step1> template and in
it I test the para number and output the correct formatting. For the
first para it outputs the para followed by the seqlist.

The second para's are where I'm having some difficulty. I need pull the
text from the second para into a table row. Then  and pull the item tags
into another row.

So my question is what's the best way to retrieve the non-nested
information in a tag?


XPATH 1.0
SAXON 6.5.5

Example tags:

<step1>
	<para>para1<seqlist>
		<item>1</item>
		<item>2</item>
		<item>3</item></seqlist></para>
	<para>Para2<seqlist>
		<item>1</item>
		<item>2</item>
		<item>3</item></seqlist></para>
	<para>para3</para>
</step1>


In this situation I need to retrieve the text between <para> &
<seqlist>. Originally I tried <xsl:apply-templates select="para[2]". But
that gave me


Para2
	1
	2
	3

The para[2] template match pulled in the seqlist formatting.

So then I tried the value-of select="para[2]" and that gave me

Para2 1 2 3

How can I select and output only what's between <para[2]> and <seqlist>?

XSL:
       <xsl:when test="para[2]">
           <table>
            <tr>
               <td style="PADDING-RIGHT: 2px"><xsl:number
count="//step1[para[2]]" format="1."/></td>
               <td><xsl:value-of select="para"/></td>
            </tr>
            </table>
       </xsl:when>

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Cast Your Vote

We need your help – Vote for DataDirect XML Products!

  • Best SOA or XML site

Winners and finalists announced at SOA World Conference in November.

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-2007 All Rights Reserved.