473,396 Members | 1,935 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Looking to traverse tree and group elements with identical xpath elements

Hi-
I have the following XML structure:
<?xml version="1.0" encoding="UTF-8"?>
<content>
<type content_type="Listing"/>
<faq_listing>
<heading>Benefits</heading>
<heading>Health</heading>
<heading>Medical Coverage</heading>
<category>
<content_category_faq>Medical Coverage - PPO</content_category_faq>
</category>
<category>
<content_category_faq>Medical Coverage - HMO</content_category_faq>
</category>
</faq_listing>
<faq_listing>
<heading>Benefits</heading>
<heading>Health</heading>
<category>
<content_category_faq>Dental</content_category_faq>
</category>
</faq_listing>
<faq_listing>
<heading>Benefits</heading>
<heading>Financial</heading>
<category>
<content_category_faq>Flexible Spending</content_category_faq>
</category>
</faq_listing>
<faq_listing>
<heading>Life Events</heading>
<category>
<content_category_faq>Getting Married</content_category_faq>
</category>
<category>
<content_category_faq>Adoption</content_category_faq>
</category>
</faq_listing>
</content>

I am looking to do something like the following to display the results:

- Benefits
- Health
- Medical Coverage
+ Medical Coverage - PPO
+ Medical Coverage - HMO
+ Dental (faq cat)
- Financial
+ Flexible Spending
- Life Events
+ Getting Married
+ Adoption

I have the HTML and Javascript to do the +/- but was looking to see if anyone had any ideas on how I could "group" like xpath values?

Thanks!
BoarderChic
Nov 25 '07 #1
1 1348
jkmyoung
2,057 Expert 2GB
Are you using DOM, or XSLT?
One way to group using XSLT: Muenchian Grouping
http://www.jenitennison.com/xslt/gro...muenchian.html
Nov 26 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

22
by: Martin MOKREJ© | last post by:
Hi, I'm looking for some easy way to do something like include in c or PHP. Imagine I would like to have: cat somefile.py a = 222 b = 111 c = 9
7
by: Rolf Kemper | last post by:
Dear All, somehow I remember that such or similar question was discussed already somewhere. But I can't find it anymore. I have a template calling itself. As long it goes deeper into the...
4
by: Gerald Aichholzer | last post by:
Hello NG, I have a XML file looking like: <!-- some elements here --> <plugin> <icon></icon> <!-- some elements here --> <object> <!-- some elements here -->
4
by: Wayne Wengert | last post by:
I am looking for pointers to good beginner books, tutorials or other resources to help me understand how to really use XML data. I program mostly in VB (I have several applications in VB6 but am...
19
by: phoenixathell | last post by:
Hi all, the PyHtmlGUI Project (http://www.sourceforge.net/projects/pyhtmlgui) is looking for developers that want to join. The aim of the project is to create a web application framework. The...
1
by: Datawich | last post by:
Hi. By persistence, I've discovered that when several nested elements in a schema are each qualified by a namespace, I can successfully reference them in a select statement by qualifying each...
8
by: =?ISO-8859-1?Q?m=E9choui?= | last post by:
Problem: - You have tree structure (XML-like) that you don't want to create 100% in memory, because it just takes too long (for instance, you need a http request to request the information from...
2
by: Jason8 | last post by:
Hi: I'm looking to get the values of QueueUrl, and RequestId from below using XPath but I can't get past soapenv:Body without using wild cards. For example these move down the tree: ...
6
by: gskbond | last post by:
Following is my logic to traverse level by level an mway search tree.... (Yeah I finally used templates to implement a queue... :) ) void mWayTree:: TraverseLevelOrder(Node *root,int lvl) {...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.