SitePoint Sponsor

User Tag List

Results 1 to 6 of 6

Thread: XML for Newbie

  1. #1
    Original Gangster silver trophy Thing's Avatar
    Join Date
    Oct 2000
    Location
    Philadelphia, PA
    Posts
    4,708
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)

    XML for Newbie

    Got a quick question for all you XML gurus out there. Ive just started learning XML and have a fairly simple question. Let me show you my code first...


    <html>

    <body>
    <xml
    src="trident.xml"
    id="xmldso"
    async="false">
    </xml>

    <table datasrc="#xmldso" width="100%" border="1">

    <thead>
    <th>ID</th>
    <th>First Name</th>
    <th>Last Name</th>
    <th>Web Site Name</th>
    <th>Description</th>
    <th>URL</th>
    <th>Date</th>

    </thead>

    <tr align="left">
    <td><span datafld="ID"></span></td>
    <td><span datafld="UserFirst"></span></td>
    <td><span datafld="UserLast"></span></td>
    <td><span datafld="websitename"></span></td>
    <td><span datafld="description"></span></td>
    <td><A HREF="<%=a%>"><span datafld="url"></span></A></td>
    <td><span datafld="DATE"></span></td>
    </tr>
    </table>

    </body>
    </html>

    Basically this works great! What I am trying to do is pull the url value from the XML page and place it into a variable. Can someone tell me how this is done. Thank you!

  2. #2
    Mlle. Ledoyen silver trophy seanf's Avatar
    Join Date
    Jan 2001
    Location
    UK
    Posts
    7,168
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'm not clear here, do you want to get the variable in ASP?

    Sean
    Harry Potter

    -- You lived inside my world so softly
    -- Protected only by the kindness of your nature

  3. #3
    Original Gangster silver trophy Thing's Avatar
    Join Date
    Oct 2000
    Location
    Philadelphia, PA
    Posts
    4,708
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Yeah. Basically just want to pull the value into a variable so I can manipulate it. Thanks

  4. #4
    \m/ R.I.P. Dimebag! \m/ JimBolla's Avatar
    Join Date
    Dec 2001
    Location
    erie, pa
    Posts
    1,130
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    are you trying to do this serverside or clientside?

  5. #5
    Original Gangster silver trophy Thing's Avatar
    Join Date
    Oct 2000
    Location
    Philadelphia, PA
    Posts
    4,708
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    server side

  6. #6
    \m/ R.I.P. Dimebag! \m/ JimBolla's Avatar
    Join Date
    Dec 2001
    Location
    erie, pa
    Posts
    1,130
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    i'm not sure if that would be the method that would do what you want to do, as the XML file that the HTML page is binding to is not doing any processing on the serverside, the variable "a" really has no meaning.
    perhaps do it clientside with something like:


    <td><A href="#" onClick="GoTo()"><span datafld="url"></span></A></td>

    and then have a javascript function:

    function GoTo() {
    location.assign(event.srcElement.innerText)
    }

    or something like that.
    Last edited by crowdozer; Mar 25, 2002 at 11:13.


Bookmarks

Posting Permissions

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