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

Re: Getting the data after and before the specified no

Subject: Re: Getting the data after and before the specified node
From: Mukul Gandhi <gandhi.mukul@xxxxxxxxx>
Date: Wed, 5 Oct 2005 21:17:29 +0530
xsl data after applying template
Hi Aaron,
  This seems to do what you want..

<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">

<xsl:output method="xml" indent="yes" />

<xsl:template match="/xml">
   <root>
     <xsl:apply-templates/>
   </root>
</xsl:template>

<xsl:template match="a">
   <xsl:apply-templates select="b" />
</xsl:template>

<xsl:template match="b">
  <label><xsl:value-of select="." /></label>
</xsl:template>

<xsl:template match="c">
   <para><xsl:value-of select="." /></para>
</xsl:template>

</xsl:stylesheet>

Regards,
Mukul

On 10/5/05, aaron apigo <aaronjose_apigo2001@xxxxxxxxx> wrote:
> hi all,
>
>   I have the problem getting the getting the data
> after and before the specified node:
>
> with this:
>
> <xml>
>    <a>
>        <b>aaron</b>
>    </a>
>    <c>butter</c>
>    <c>bread</c>
>    <c>fly</c>
>    <c>team</c>
>    <a>
>        <b>JOSE</b>
>    </a>
>    <c>jack</c>
>    <c>mary</c>
>    <c>seph</c>
>    <c>try</c>
>    <a>
>        <b>Andrew</b>
>    </a>
>    <c>aaron</c>
> </xml>
>
> output should be:
>
> <?xml version="1.0" encoding="utf-8"?>
> <root>
> <label>aaron</label>
>    <para>butter</para>
>    <para>bread</para>
>    <para>fly</para>
>    <para>team</para>
> <label>JOSE</label>
>    <para>jack</para>
>    <para>mary</para>
>    <para>seph</para>
>    <para>try</para>
> <label>Andrew</label>
>    <para>aaron</para>
> </root>
>
> I have this XSL:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <xsl:stylesheet
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
> version="1.0">
>
>    <xsl:template match="/xml">
>     <xsl:apply-templates select="a" mode="test"/>
>    </xsl:template>
>
>    <xsl:template match="a" mode="test">
>        <label>
>           <xsl:apply-templates select="b"/>
>        </label>
>        <para>
>            <xsl:apply-templates
> select="following::c[?????????]"/>
>        </para>
>    </xsl:template>
>
>    <xsl:template match="b">
>        <xsl:apply-templates/>
>    </xsl:template>
>
> </xsl:stylesheet>
>
> with this XSL, all the <c> were captured, what i want
> is only the <c> that comes after <a> but before the
> next <a>?
> any idea on this.
>
> thanks in advance.
>
> regards.
> aaron
>
>
>
>
>
>
> __________________________________
> Yahoo! Mail - PC Magazine Editors' Choice 2005
> http://mail.yahoo.com

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.