add a node to XMLDocument

Discussion in 'XML' started by Peter Morris, Mar 20, 2010.

  1. Peter Morris

    Peter Morris Guest

    Hi, I'm new to XML programming.

    I'm writing a program in Visual Basic.Net that retrieves XML data
    from eBay. I want to store the results of a query in an xmlDocument.

    Here is an example, I pass an item number, and get back XML information
    about that listing. Response format here.

    I have an XML document that keeps a list of information about various items.
    I only
    use a few of the fields there.

    <?xml version="1.0" encoding="utf-8"?>
    <Title>iPod shuffle</Title>
    <Title>Video Recorder</Title>
    <TimeLeft>1hr 12</TimeLeft>

    Note - the autobid element isn't from eBay, I set it myself, it's the
    amout I'm willing to bid for that item.

    When I retrieve data for an item from eBay, I want to do the following:
    1) create a new item node.
    2) copy the information from the eBay XML to my node, and set the AB amount
    3) add the new node to my xmlDocument.

    What is the code to do this?

    Let's suppose that I have the response stream from eBay, and have extracted
    the XML from it into an XMLDocument called ebay_item_XML , my list of
    items is loaded into an XMLDocument called list_of_items, and I want to
    set an autobid of 23.99

    Dim item_list as XMLDocument
    ' load item_list from file


    Dim eBay_item_xml as XMLDocument
    Dim sr As New StreamReader(incoming_stream)
    ' get the incoming stream into an XML document
    Peter Morris, Mar 20, 2010
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.