Re: Extracting data from an XML to put into a constant



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.


.



Relevant Pages

  • Re: Can I make one long document with no page breaks?
    ... > list this info and page breaks clutter things up. ... > also if I want to turn it into an xml document as well. ... Print/Page Layout? ... This reply is posted in the Newsgroup; please post any follow question or reply ...
    (microsoft.public.word.pagelayout)
  • Re: How to change RevNum back to 0 presently 8.
    ... patience!), ... close and re-open (this time as an XML document) and you should be able to ... resave as a Word Document. ... the newsgroup and not by e-mail :-) ...
    (microsoft.public.word.pagelayout)
  • Re: Databinding client side. Still only option RDS?
    ... You treat the data island as if it was a DOMDocument (which it ... I've never tried using a streamed recordset for databinding. ... elements are bound to attributes in the xml document. ... Please follow up in a more appropriate newsgroup. ...
    (microsoft.public.inetserver.asp.db)
  • Re: Pass XML string to ASP Function Problem
    ... the tags will be there ... > retrieve the data one by one?? ... You need to use an XML Document, and load your xml into it: ... Please reply to the newsgroup. ...
    (microsoft.public.inetserver.asp.general)
  • Re: Error 0403-010 installing CRS Patch 10.2.0.4 in AXI 6L
    ... IBM wrote: ... and when I run the root102.sh in the first node I have the fallowing ... A newsgroup is not the right place for this question. ...
    (comp.databases.oracle.server)

Loading