Results 1 to 2 of 2
  1. #1
    Join Date
    Apr 2004

    Question Unanswered: Hlp me for XML to ASP

    Plz anyone help me out with sample of how to get data
    from XML in ASP.

  2. #2
    Join Date
    Feb 2003
    Denver, CO
    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

    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>"

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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts