Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XSLT
|
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 May 23rd, 2005, 05:14 AM
Authorized User
 
Join Date: May 2005
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to meetnaveen4u
Default generate id grouping using xslt

Sample Xml File...
<books>
    <book id="1">
        <name>example</name>
        <publisher>abc</publisher>
        <pric>1.22</price>
    </book>
    <book id="2">
        <name>example1</name>
        <publisher>abc1</publisher>
        <pric>1.23</price>
     </book>
    <book id="2">
        <name>example1</name>
            <pric>1.23</price>
     </book>
    <publisherNote>
        <price>1.23</price>
        <publisher>abc2</publisher>
    </publisherNote>
    <book id="1">
        <name>example</name>
        <publisher>abc</publisher>
        <pric>1.22</price>
    </book>
    <book id="3>
        <name>exchange</name>
        <publisher>abc</publisher>
        <pric>1.22</price>
    </book>

I need to group book by name, publisher and pric values. for the nodes which dont have publisher should match with publisherNote with price=pric and take this pric as reference to get publisher node and group and display sum value for each of books.

Please help me as i am urgently need any solution to solve this problem.

Expected output is
<generalBooks>
    <bookDetails>
        <name>example</name>
        <publisherDetails>abc</publisherDetails>
        <amt>2.44<amt>
    </bookDetails>
    <bookDetails>
        <name>exchange</name>
        <publisherDetails>abc</publisherDetails>
        <amt>1.22<amt>
    </bookDetails>
    <bookDetails>
        <name>example1</name>
        <publisherDetails>abc1<publisherDetails>
        <amt>1.23</amt>
    </bookDetails>
    <bookDetails>
        <name>example1</name>
        <publisherDetails>abc2<publisherDetails>
        <amt>1.23</amt>
    </bookDetails>
</generalBooks>
 I was trying to use generate-id concepts but i am failing becoz i had to group the publisher depending on avaliablity if not present then we have to search each of book section which has this pric match with publisherNote price value and take this publisher details and group together.

I need solution to solve this problem, if you can provide the code this would be great help for me.

Regards
Naveen.

Thanks &amp; Regards
Naveen.
__________________
Thanks and Regards
Naveen.





Similar Threads
Thread Thread Starter Forum Replies Last Post
generate unique id capri SQL Server 2000 1 April 6th, 2008 10:18 AM
Can XSLT read DTD/schema and Generate XSLT.. ROCXY XSLT 1 November 6th, 2006 09:39 AM
Generate-id problem. meetnaveen4u XSLT 2 May 13th, 2005 12:06 AM
How to Auto Generate ID (Primary Key) SQL Database havering SQL Server ASP 1 December 9th, 2004 05:33 AM
Generate unique ID when populating a table sroman SQL Server 2000 2 August 5th, 2003 03:38 AM





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