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

Re: Retrieving info between two tags.

Subject: Re: Retrieving info between two tags.
From: Abel Braaksma <abel.online@xxxxxxxxx>
Date: Thu, 30 Aug 2007 21:29:38 +0200
Re:  Retrieving info between two tags.
Maxine Pensyl-Johnson wrote:
I removed the step1 and it worked.

then your input is different from what you posted, or your context item is different. But if you used the /step1/.. syntax, the context is "ignored": i.e., the path is absolute. If your data does not have a root node with <step1> (as it does in what you showed us), it will not work. Same for the stylesheet of Charles below, it will only work when you test it with the same data you've given us.


Moral of this story: be sure that what you post to this list is equal to your testing environment, or make sure that we are given enough info of your testing environment (in this case, it might've been that your select path was inside an <xsl:template match="step1"> which would explain the lot).

Cheers,
-- Abel Braaksma


-----Original Message-----
From: cknell@xxxxxxxxxx [mailto:cknell@xxxxxxxxxx] Sent: Thursday, August 30, 2007 8:51 AM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: RE: RE: Retrieving info between two tags.


This stylesheet:

<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  <xsl:strip-space elements="*" />
  <xsl:output method="xml" indent="yes" encoding="UTF-8" />

    <xsl:template match="/">
      <xsl:value-of select="step1/para[2]/node()[1]" />
    </xsl:template>

</xsl:stylesheet>

When run against this document:

<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>

Produces this output:

<?xml version="1.0" encoding="UTF-8"?>Para2

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.