• Reading XML with VBScript

    Author
    Topic
    #415435

    Can anyone tell me how to read an XML data file with VBscript? I have an XML file of the format

    someref
    sometitle
    somedate

    .
    .
    .

    Now I want to use VBScript scripts in an ASP file to read that XML file and then use the data to format a table. So in some way, I want to derive VB variables, say, strRef, strTitle, strDate, and populate a table by coding

    for each in the XML file.

    My problem is that I can’t find a method that works. I’ve tried XMLRead which looked promising, but I couldn’t find a way of getting the page to display in any way! I must be doing something wrong! Can anyone provide me with all that I need to code round what I’ve put here? Or am I mistaken that this can actually be achieved? I’m aware that I can use simple XML to achieve what I want EXCEPT for the href value – that’s what’s driving me crazy! Thanks in advance.

    Viewing 1 reply thread
    Author
    Replies
    • #928060

      I might have a solution for you — I have a ‘proof of concept’ set of pages that can take an XML datafile and output it to a sortable HTML table. The code is a little much to post here, but the nut seems to be involved in this snippet:

      document.all(“tbl”).innerHTML = proc.output
      elseif el.id = “optRemove” then
      set proc = TemplateNoDups.createProcessor
      proc.input = xml
      proc.transform
      s = proc.output
      set xml = createObject(“msxml2.DOMDocument”)
      xml.async=false
      xml.loadXML s
      set proc = Template.createprocessor
      proc.input = xml
      proc.transform
      document.all(“tbl”).innerHTML = proc.output

      which uses (“tbl”).innerHTML

      If you’re interested I can send you the concept pages and you can wack around with it…I got this from an article that will give you all the details, but it’s a little skimply on the output to table in and of itself.

    • #928872

      I posted in your other thread, post 453074.

    Viewing 1 reply thread
    Reply To: Reading XML with VBScript

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: