Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XML
|
XML General XML discussions.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XML 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
 
Old June 30th, 2004, 09:28 AM
Registered User
 
Join Date: Jun 2004
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default XML DOM / ASP 3.0

Hello World.

I'm trying to format and send XML styled text and table layouts to a browser using the XML DOM and ASP 3.0.

I need to:

1. Specify a section of an XML document by its top level node
2. Define the formatting for individual nodes within the section
3. Iterate down the tree to the leaf node presenting any text, lists, links, file references, images or table definitions to the browser and formatting as necessary
4. Fin

It sounds so simple, I'm sure I must be missing something really obvious.

I have the formatting and section specification sorted, I just can't figure out how to use the DOM to iterate down to the leaf node of each child node, writing the text to the screen as I go along, and then move to the next sibling and do the same.

I have tried subroutines within subroutines within for next loops, all to no avail. Can anyone help?? If only for the sake of my sanity.

Muchas gracias!

 
Old July 13th, 2004, 12:23 AM
Registered User
 
Join Date: Jun 2004
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi friend,
I think you have tried lot as your post sound like. From your post I though you have made functions If possible you try for STACK which operate in LIFO manner from DOM you can get whether the node has a child or not if yes then add to stack after adding to stack again check from top any element had child if again push the element else pop the element from this logic you can get each and every node of your XML from your root and implementing STACK you have to do
If possible try this
You can use the loop like this which will give you the childs of node

For cnt = 0 To oNodeList.Item(0).childNodes.length - 1
             Set oNode = oNodeList.Item(0).childNodes.Item(cnt)
                  MsgBox oNode.Text
                  MsgBox oNode.Attributes.getNamedItem("code").Text
             Set oNode = Nothing
         Next

Sunil Yenpure







Similar Threads
Thread Thread Starter Forum Replies Last Post
Parsing xml using DOM balarkavelidi XML 1 January 31st, 2006 10:28 PM
Compressed XML in DOM Sam_saha XML 2 April 11th, 2004 06:18 PM
Loop in XML DOM? omallec XML 3 November 27th, 2003 09:16 AM
XML DOM with JScript --- PLEASE HELP!!! bebe XML 4 October 1st, 2003 11:40 AM
XML DOM and Javascript lilu XML 3 September 25th, 2003 07:55 AM





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