aspose file tools*
The moose likes HTML, CSS and JavaScript and the fly likes JQuery XML parsing and HTML construction Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "JQuery XML parsing and HTML construction" Watch "JQuery XML parsing and HTML construction" New topic
Author

JQuery XML parsing and HTML construction

Tarik Ansari
Ranch Hand

Joined: Dec 31, 2008
Posts: 50
Hi All,

I am in need of a technical expertise inorder to format XML and render in below html format. i have been using JQuery XML parser and i need help in constructing the html portion alone.

Data.xml


JQuery function



Below is the HTML output required


Since i am new to JQuery could you please help me in looping and rendering?

Any leads also much appreciated.

Thanks
Tarik
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15299
    
    6

What isn't working? You said you need help but you don't tell us about what specifically.


GenRocket - Experts at Building Test Data
Tarik Ansari
Ranch Hand

Joined: Dec 31, 2008
Posts: 50
Below are my elaborations:

I need to generate the below HTML from the JQuery function.


I need your help in the looping/building part which groups and adds sub-categories to the HTML from XML:
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15299
    
    6

Yes, you said you need help. Tell us what specifically isn't working and what is happening instead. If you're not getting the desired output, what are you getting? Does it throw any errors? If so, what errors? TellTheDetails.
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
Do you really have a <bd> tag in your html that you are referencing with $('bd')?

Eric
Tarik Ansari
Ranch Hand

Joined: Dec 31, 2008
Posts: 50
Making it more clearer:
In the below XML i have the Category "Sales" 2 times and "Products" 4 times. I need to group those Categories as single "Sales" and "Products" and the corresponding number of URLMenu should come under those single categories.

Data.xml

JQuery Function

Expected Result:

Also note that "Products" has subcategory "International" in XML and it also needs to be listed.

Could you please help me in re-writing the JQuery function to support the expected result?

As of now i am getting all the XML "category" with the number of times the "Products" and "Sales" are present.

I am new to JQuery and have been breaking my heads for days. Your help will be highly appreciated.

Thanks
Tarik
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: JQuery XML parsing and HTML construction