473,399 Members | 4,254 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,399 software developers and data experts.

Help with parsing XML document.

Hi, I am going nuts with this. Can you help me write a code to parse this
XML document. I need to get values from all the tags and assign them into
variables. See code below. The code is in VBScript.

Many thanks,
Roger.

<%
option explicit
response.expires = 0
Response.CacheControl = "no-cache"
response.buffer = true
Response.ContentType = "text/html"

Dim xmlString

xmlString = "<?xml version=""1.0""?>" & _
"<ResponseService Version=""2.3"">" & _
" <Header>" & _
" <Partner>UserName</Partner>" & _
" <Password>Password</Password>" & _
" <ServiceID>1</ServiceID>" & _
" </Header>" & _
" <ResponseList>" & _
" <Response SequenceNumber=""1"" Type=""ALA"" Format=""Text"">" & _
" <TransactionID>215980</TransactionID>" & _
" <OriginatingNumber>447900000000</OriginatingNumber>" & _
" <Time>200412181427</Time>" & _
" <Data>This is a message.</Data>" & _
" <Deliverer>1</Deliverer>" & _
" <Destination>12345</Destination>" & _
" <Operator>99999</Operator>" & _
" <Tariff>150</Tariff>" & _
" <SessionId>SessionID</SessionId>" & _
" <Tags>" & _
" <Tag Name=""Number"">12</Tag>" & _
" <Tag Name=""City"">Rome</Tag>" & _
" </Tags>" & _
" </Response>" & _
" </ResponseList>" & _
"</ResponseService>"
Dim XMLDoc, rootNode, Header, item, i, strSnowHeight, ResponseList
Set XMLDoc = Server.CreateObject("Microsoft.XMLDOM")
XMLDoc.async = False
XMLDoc.loadXML(xmlString)
Set rootNode = XMLDoc.documentElement
Dim Partner, Password, ServiceID, TransactionID, OriginatingNumber, Time,
Data
Dim Deliverer, Destination, Operator, Tariff, SessionId, Number, City
'CAN YOU HELP ME WITH THE CODE TO PARSE VALUES FROM THE ABOVE XML DOCUMENT
AND ASSIGN THEM TO THE VARIABLES BELOW?
Partner =
Password =
ServiceID =
TransactionID =
OriginatingNumber =
Time =
Data =
Deliverer =
Destination =
Operator =
Tariff =
SessionId =
Number =
City =
Jul 17 '06 #1
0 826

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Cigdem | last post by:
Hello, I am trying to parse the XML files that the user selects(XML files are on anoher OS400 system called "wkdis3"). But i am permenantly getting that error: Directory0: \\wkdis3\ROOT\home...
16
by: Terry | last post by:
Hi, This is a newbie's question. I want to preload 4 images and only when all 4 images has been loaded into browser's cache, I want to start a slideshow() function. If images are not completed...
4
by: Erik Moore | last post by:
I am both producing and parsing an xml document that needs to be validated against a schema. I wanted some consumers of the document to have the option of not performing a validation, so I left the...
3
by: David Svoboda | last post by:
I have a server program that takes commands and acts on them. The server program can also take these commands from an input file or standard input (mainly for testing purposes). As such, I often...
5
by: randy | last post by:
Can some point me to a good example of parsing XML using C# 2.0? Thanks
1
by: pbd22 | last post by:
hi. for some reason i am not able to navigate the dom. i keep getting the 'no properties' error but i think i am doing everything right. this is an XML response from an AJAX call. The ajax...
0
by: gunimpi | last post by:
http://www.vbforums.com/showthread.php?p=2745431#post2745431 ******************************************************** VB6 OR VBA & Webbrowser DOM Tiny $50 Mini Project Programmer help wanted...
2
by: hzgt9b | last post by:
I've written a simple javascript page that parses an XML file... (Actually I just modified the "Parsing an XML File" sample from http://www.w3schools.com/dom/dom_parser.asp) The page works great...
2
by: nicky123 | last post by:
Hi everyone, This is a brief description that I have provided for parsing & displaying an XML document using DOM API. Please feel free to post your own comments & views regarding...
2
by: embz | last post by:
this post concerns three pages. 1. this page: http://www.katherine-designs.com/sendemail.php i get the following errors: a lot of it seems to deal with the PHP code i inserted to the page....
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
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...

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.