Webmaster Forum

Go Back   Webmaster Forum > Web Development > Coding Forum

Coding Forum Problems with your code? Discuss coding issues, including JavaScript, PHP & MySQL, HTML & CSS, Flash & ActionScript, and more.


Reply
 
LinkBack Thread Tools Display Modes
Old 03-18-2009, 03:52 PM   #1 (permalink)
v7n Mentor
 
imaginemn's Avatar
 
Join Date: 02-18-04
Location: Minneapolis, Minnesota
Posts: 1,356
iTrader: 0 / 0%
Latest Blog:
None

imaginemn is a name known to allimaginemn is a name known to allimaginemn is a name known to allimaginemn is a name known to allimaginemn is a name known to allimaginemn is a name known to allimaginemn is a name known to allimaginemn is a name known to allimaginemn is a name known to allimaginemn is a name known to allimaginemn is a name known to all
Send a message via MSN to imaginemn Send a message via Yahoo to imaginemn Send a message via Skype™ to imaginemn
Question XML - nested nodes issue - ASP Classic

One of my clients has an issue with an ASP Classic script that I need help with.

The script works fine with the exception of the nested day-plan nodes. I need some sort of logic to loop through the nested records. The script only brings back the first record and not any of the nested one's in the day-plans array node.

Any help will be appreciated! If you know how to do it in PHP, ColdFusion or even .NET....that may point me in the right direction to fixing this. It's been a while for me so looking for help!

Thanks in advance!

XML FILE

Code:
<?xml version="1.0" encoding="UTF-8"?> <lessons type="array"> <lesson> <club type="integer">174</club> <resource>STUDIO 2</resource> <day-plans type="array"> <day-plan> <day-plan type="integer">4</day-plan> <res-units type="integer">75</res-units> <reservation type="integer">35342</reservation> <start-time type="datetime">2008-11-14T05:45:00-06:00</start-time> </day-plan> <day-plan> <day-plan type="integer">6</day-plan> <res-units type="integer">75</res-units> <reservation type="integer">35342</reservation> <start-time type="datetime">2008-11-14T05:45:00-06:00</start-time> </day-plan> </day-plans> </lesson> <lesson> <club type="integer">177</club> <resource>STUDIO 1</resource> <day-plans type="array"> <day-plan> <day-plan type="integer">6</day-plan> <res-units type="integer">75</res-units> <reservation type="integer">35342</reservation> <start-time type="datetime">2008-11-14T05:45:00-06:00</start-time> </day-plan> </day-plans> </lesson> </lessons>
ASP Parser Script

Code:
<% Set objXML = Server.CreateObject("Microsoft.XMLDOM") objXML.async = False objXML.Load (Server.MapPath("myfile.xml")) i=0 For Each route in objXML.documentElement.SelectNodes("/lessons/lesson") response.write TRIM(objXML.getElementsByTagName("club").item(i).childNodes(0).text) & "<BR>" response.write TRIM(objXML.getElementsByTagName("resource").item(i).childNodes(0).text) & "<BR>" response.write TRIM(objXML.getElementsByTagName("day-plan").item(i).childNodes(0).text) & "<BR>" i=i+1 next %>
__________________
Need a project done? - Set Your Own Price!
Imagine Creative Services
- Design : Marketing : Multimedia : More
imaginemn is offline  
Add Post to del.icio.us
Reply With Quote
Old 03-22-2009, 11:33 PM   #2 (permalink)
Meeow!
 
Costin Trifan's Avatar
 
Join Date: 04-13-07
Location: Romania
Posts: 3,235
iTrader: 0 / 0%
Latest Blog:
None

Costin Trifan is a web professional of the highest orderCostin Trifan is a web professional of the highest orderCostin Trifan is a web professional of the highest orderCostin Trifan is a web professional of the highest orderCostin Trifan is a web professional of the highest orderCostin Trifan is a web professional of the highest orderCostin Trifan is a web professional of the highest orderCostin Trifan is a web professional of the highest orderCostin Trifan is a web professional of the highest orderCostin Trifan is a web professional of the highest orderCostin Trifan is a web professional of the highest order
you need to do another foreach for <day-plan>
__________________
...to be continued
Costin Trifan is offline  
Add Post to del.icio.us
Reply With Quote
Go Back   Webmaster Forum > Web Development > Coding Forum

Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Facebook Gift Application v9.0 - Nested categories, Multi-language, Improved design+ namepimp Content 3 05-15-2009 07:30 PM
Does nested CSS exist? thenextbesthang Coding Forum 2 11-13-2006 12:07 PM
IE and my nested table kboscho Coding Forum 4 08-03-2006 04:29 PM
Nested Layers "Freaking out" -- NOT WYSIWYG in the slightest buzybonnie Web Design Lobby 4 03-11-2006 11:03 PM


Sponsor Links
Get exposure! Contextual Links V7N SEO Blog V7N Directory


All times are GMT -7. The time now is 02:03 AM.
© Copyright 2008 V7 Inc
Powered by vBulletin
Copyright © 2000-2009 Jelsoft Enterprises Limited.


Search Engine Optimization by vBSEO 3.3.0 ©2009, Crawlability, Inc.