Wrox Programmer Forums
|
Classic ASP XML Using ASP 3 and XML. See also the XML category for more XML discussions not relating to ASP. NOT for ASP.NET 1.0, 1.1, or 2.0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP 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 August 17th, 2004, 03:41 AM
Registered User
 
Join Date: Aug 2004
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default use asp to get data from xml (user defined)

hi, I had write an asp file to get data from an xml named "data.xml" and below is the coding:

Dim xml
Set xml = Server.CreateObject("Microsoft.XMLDOM")
xml.async = False
xml.load (Server.MapPath("data.xml"))
Dim fText1, fText2
fText1 = xml.documentElement.childNodes(0).text
fText2 = xml.documentElement.childNodes(1).text
Set xml = Nothing

It's all Ok and can run. But my problem here is I want to call an xml file that I don't know its name (not "data.xml"). The xml file pass by the user who call my asp file. The user can pass the xml via anything for example asp or VB component. So I will not know exactly what the name of the xml file.

Thanks.
 
Old August 18th, 2004, 07:40 AM
Authorized User
 
Join Date: Jun 2003
Posts: 57
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to Kabe
Default

you need this?

login + passw potional, i think u can leave them empty

dim objxml, url
url = "http://yourfile_thatreturn_a_valid_xml.asp"
set objxml = server.CreateObject("msxml2.xmlhttp.4.0")
objxml.open "get",url,false,"login","passw"
objxml.send

grzz
kabe.be
 
Old August 18th, 2004, 07:44 AM
Authorized User
 
Join Date: Jun 2003
Posts: 57
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to Kabe
Default

forgot this, to read ur xmlobject

value = objxml.responseXml.selectsinglenode("XPath").text
 
Old August 18th, 2004, 10:16 PM
Registered User
 
Join Date: Aug 2004
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks Kabe for your help..

I would like to correct some mistakes that I had made in my post.
Actually the thing go like this:
--I need to create an asp that can called by other page that written by other people. The page that writen by other people can be anything for example asp and it contains the xml inside it. So the page will call my asp file then I need to grab data from it. The data that I retrieve is inside the particular element that I need.
For example I need to retrieve the data for username and password, so I just need to find the elements with <user> and <pwd> only inside the page that call my asp.
I will not consider element other that this. So the page must correctly put <user> other than <usr>.

So it is still suitable to put XMLHTTP?

Regards,
vivian








Similar Threads
Thread Thread Starter Forum Replies Last Post
ADODB.Connection user-defined type not defined Wall st Guru Excel VBA 2 March 26th, 2014 03:44 PM
User-defined functions fredh Excel VBA 1 May 7th, 2007 10:28 AM
User-defined type not defined (Icecream.mdb) dloren01 BOOK: Beginning Access VBA 0 June 22nd, 2005 10:36 PM
ADO and user-defined data types rgerald SQL Server 2000 3 June 20th, 2005 11:43 AM
user defined templates clandestine XML 2 June 15th, 2005 08:27 AM





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