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

Re: Are non-linear transformation possible?

Subject: Re: Are non-linear transformation possible?
From: "Marrow" <marrow@xxxxxxxxxxxxxx>
Date: Fri, 16 Aug 2002 18:55:08 +0100
non linear transform
Hi Rich,

Something like?...

== XSL ===================================
<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" indent="yes"/>
<xsl:template match="allresults">
  <results>
    <xsl:apply-templates select="results[1]/row"/>
  </results>
</xsl:template>

<xsl:template match="row">
  <xsl:variable name="curr-pos" select="position()"/>
  <row>
    <xsl:copy-of
select="node()|../following-sibling::results/row[$curr-pos]/node()"/>
  </row>
</xsl:template>
</xsl:stylesheet>
== end of XSL ==============================

Hope this helps
Marrow
http://www.marrowsoft.com - home of Xselerator (XSLT IDE and debugger)
http://www.topxml.com/Xselerator



-----Original Message-----
From: Richard Bolen <bolen@xxxxxxxxxxxxxxxxx>
To: XSL Mailing List (E-mail) <XSL-List@xxxxxxxxxxxxxxxxxxxxxx>
Date: 16 August 2002 18:41
Subject:  Are non-linear transformation possible?


>What I mean be this is can you convert a source document that looks like this:
>
><allresults>
> <results>
>  <row>
>    <field>some data</field>
>    <field>some data</field>
>  </row>
>  <row>
>    <field>some data</field>
>    <field>some data</field>
>  </row>
> </results>
> <results>
>  <row>
>    <field>some data</field>
>  </row>
>  <row>
>    <field>some data</field>
>  </row>
> </results>
></allresults>
>
>
>into this:
>
><results>
>  <row>
>    <field>some data</field>
>    <field>some data</field>
>    <field>some data</field>
>  </row>
>  <row>
>    <field>some data</field>
>    <field>some data</field>
>    <field>some data</field>
>  </row>
></results>
>
>
>In other words, I'd like to merge these 2 separate result sets into one result
set.
>
>This seems like a basic thing to do with XSLT but I can't figure out the logic
for my transformation sheet.
>
>Thanks,
>Rich
>--------------------------------------------------------------------
>Rich Bolen
>Senior Software Developer
>GretagMacbeth Advanced Technologies Center
>79 T. W. Alexander Drive - Bldg. 4401 - Suite 250
>PO Box 14026
>Research Triangle Park, North Carolina 27709-4026  USA
>Phone:  919-549-7575 x239,  Fax: 919-549-0421
>
>http://www.gretagmacbeth.com/
>--------------------------------------------------------------------
>
>
> XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
>


 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.