473,378 Members | 1,671 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,378 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 1345
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) {...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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...

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.