Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XSLT
| Search | Today's Posts | Mark Forums Read
XSLT General questions and answers about XSLT. For issues strictly specific to the book XSLT 1.1 Programmers Reference, please post to that forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XSLT section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 4th, 2004, 05:17 AM
Authorized User
 
Join Date: Nov 2003
Location: bangalore, karnataka, India.
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default how to arrange elements group wise.

suppose i have an xml file like:
<Table>
<IO_Body>

    <name> srini</name>
    <name> ramesh</name>
    <name> rama</name>

    <phone>22382</phone>

    <name>krish</name>
    <name>latha</name>
    <name>asha</name>

    <phone>43452</phone>

    <name>kumar</name>
    <name>xxx</name>
    <name>yyy</name>
</IO_Body>
</Table>
here the first 3 names are not having a phone number.
after that for each group phone number is there.

like this some sets may have phone number and some other sets may not have a phone number.

now i have to write an xSl so that the result should be of the form:

<Row>
    <Cell>
        <Data ss:Type="String">srini</Data>
    </Cell>
    <Cell>
        <Data ss:Type="String">ramesh</Data>
    </Cell>
    <Cell>
        <Data ss:Type="String">rama</Data>
    </Cell>
</Row>
<Row>
    <Cell>
        <Data ss:Type="String">22382</Data>
    </Cell>
</Row>
<Row>
    <Cell>
        <Data ss:Type="String">krish</Data>
    </Cell>
    <Cell>
        <Data ss:Type="String">latha</Data>
    </Cell>
    <Cell>
        <Data ss:Type="String">asha</Data>
    </Cell>
</Row>
<Row>
    <Cell>
        <Data ss:Type="String">43452</Data>
    </Cell>
</Row>
<Row>
    <Cell>
        <Data ss:Type="String">kumar</Data>
    </Cell>
    <Cell>
        <Data ss:Type="String">xxx</Data>
    </Cell>
    <Cell>
        <Data ss:Type="String">yyy</Data>
    </Cell>
</Row>

please help me.
srini.




srini
__________________
srini




Similar Threads
Thread Thread Starter Forum Replies Last Post
Xsl: strip-space elements; and 'group-adjacent' ROCXY XSLT 6 July 15th, 2010 08:59 AM
How to group xsl elements in xslt.10 suji XSLT 1 February 29th, 2008 03:44 AM
first n elements with highest counts in a group manish_jaiswal XSLT 6 February 8th, 2008 09:16 PM
Arrange dynamic cells... Roshu Javascript How-To 1 January 11th, 2005 06:55 AM
putting <element> round group of same elements jefke XSLT 0 May 24th, 2004 10:18 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.