Re: Extracting data from an XML to put into a constant
- From: "Bob Barrows [MVP]" <reb01501@xxxxxxxxxxxxxxx>
- Date: Tue, 25 Mar 2008 11:23:44 -0400
wills.jason@xxxxxxxxx wrote:
what i need to do is to put the <FolderID> into a constant within my
script,
Well, you cannot set a contant's value at runtime: constants can only be
set at compile time, which means you can only use literal values when
defining the constants. You have to set the value to a variable instead.
My preference would be to use an xml document, like this:
set xmldoc=createobject("msxml2.domdocument")
xmldoc.load("p:\ath\to\filename.xml")
set node=nothing
set node=xmldoc.selectsinglenode("//FolderID")
in not node is nothing then
msgbox node.text
'or assign it to a variable
end if
You should go to msdn and read the documentation for xpath query syntax
(the "//FolderID" string is a simple xpath query that will be used by
the selectSingleNode method to retrieve the first node with that name).
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
.
- Follow-Ups:
- Re: Extracting data from an XML to put into a constant
- From: mr_unreliable
- Re: Extracting data from an XML to put into a constant
- From: Paul Randall
- Re: Extracting data from an XML to put into a constant
- References:
- Extracting data from an XML to put into a constant
- From: wills.jason@xxxxxxxxx
- Extracting data from an XML to put into a constant
- Prev by Date: Re: Extracting data from an XML to put into a constant
- Next by Date: Re: Extracting data from an XML to put into a constant
- Previous by thread: Re: Extracting data from an XML to put into a constant
- Next by thread: Re: Extracting data from an XML to put into a constant
- Index(es):
Relevant Pages
|
Loading