If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ASP > Hlp me for XML to ASP

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 04-08-04, 02:14
sgravi sgravi is offline
Registered User
 
Join Date: Apr 2004
Posts: 2
Question Hlp me for XML to ASP

Plz anyone help me out with sample of how to get data
from XML in ASP.
Reply With Quote
  #2 (permalink)  
Old 04-08-04, 11:29
Wigz Wigz is offline
Registered User
 
Join Date: Feb 2003
Location: Denver, CO
Posts: 34
Reading or "Parsing" XML with ASP:

set objXML = CreateObject("Microsoft.XMLDOM")
set objLst = CreateObject("Microsoft.XMLDOM")
objXML.async = false

strXML = "somefile.xml"

objXML.LoadXML strXML
set objLst = objXML.getElementsByTagName("*")

for i = 2 to (objLst.length - 1)
msgbox objLst.item(i).text
next

set objXML = Nothing
set objLst = Nothing

Writing XML with ASP:

Dim objFSO
Dim objStream
Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
Set objStream = objFSO.OpenTextFile("C:\Commands.XML", ForWriting, True)
objStream.WriteLine "<scm>"
objStream.WriteLine " <commands>"
objStream.WriteLine " <command>stop</command>"
objStream.WriteLine " </commands>"
objStream.WriteLine "</scm>"
objStream.Close

These are pretty simple examples, let me know if you need help with a specific problem ...
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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