need some help

Results 1 to 2 of 2

Thread: need some help

  1. #1
    Join Date
    Dec 1969

    Default need some help

    I have an XML file that i need to read via asp, i&#039;m passing in the tag i want to read from the XML file and read the value/data of that tag, how can i do that?<BR><BR>Heres what i have:<BR><BR>heres my asp code:<BR>Set oDOM = Server.CreateObject("msxml2.DOMDocument.4.0")<BR> myXML = fRead("c: estxml.xml") &#039;my XML file that Im&#039; reading<BR> oDOM.loadXML(myXML)<BR><BR>Response.Write oDOM.selectSingleNode("//FIELD[@NAME=&#039;firstname&#039;]").text &#039;i want firstname dynamic if possible instead of hardcoding it<BR><BR>this is what my XML looks like:<BR><BR>&#060;docset&#062;<BR> &#060;field name="firstname"&#062;Joe&#060;/field&#062;<BR>&#060;/docset&#062;<BR><BR>I want to pass "firstname" to my asp page and get the value back of Joe, <BR><BR>

  2. #2
    Join Date
    Dec 1969

    Default XML is case SENSITIVE

    You can&#039;t use FIELD to mean field or NAME to mean name.<BR><BR>As for making the parameter dynamic:<BR> Dim xpath<BR> xpath = "//field[@name=&#039;" & whatever & "&#039;]"<BR><BR>No different that building SQL queries as strings.<BR><BR>

Posting Permissions

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