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
  #1 (permalink)  
Old April 3rd, 2014, 09:46 AM
Registered User
Points: 10, Level: 1
Points: 10, Level: 1 Points: 10, Level: 1 Points: 10, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Apr 2014
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default selecting sibling or cousin of current element

I'm trying to group elements with similar headings together, the problem is that I don't know how they are going to appear in the xml, I just know the parent of the elements to be mapped, and the element name.

Code:
xml:

<element1>
    <entry>
        <section>
            <title>title</title>
       </section>
        <section>
            <title>title</title>
       </section>
    </entry>
    <entry>
        <section>
            <title>title2</title>
       </section>
    </entry>
    <entry>
        <section>
            <title>title3</title>
       </section>
    </entry>
    <entry>
        <section>
            <title>title4</title>
            <section>
                 <section>
                     <title>title5</title>
                 </section>
             </section>
            <section>
                 <section>
                     <title>title5</title>
                 </section>
             </section>
       </section>
    </entry>
</element1>
I managed to group together the elements of the first level, but beyond that I can't get an xpath that will always work.


Similar Threads
Thread Thread Starter Forum Replies Last Post
Conditionally selecting following element seb XSLT 6 February 2nd, 2012 12:08 PM
Extracting second chlid element of same parent node using following-sibling ROCXY XSLT 3 May 22nd, 2009 10:56 AM
Want to Pull multiple following-sibling data to preceding-sibling element sameer_kadam XSLT 4 May 9th, 2009 08:07 AM
check name of the current node element in xml arunagottimukkala XSLT 19 October 19th, 2007 04:44 AM
Value of parent element of current-grouping-key() bonekrusher XSLT 2 September 9th, 2007 06:29 AM





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