XML Data Islands


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: XML Data Islands

  1. #1
    Byron Guest

    XML Data Islands


    I have a XML Data Island on my page. How can I extract the record I need
    from the data island. For instance, if I have a data island populated with
    order records and I need to retrieve only the record for a certain order
    id (ex:OrderId = 214).

    I'm sure this is probably basic, but I am pretty new to this.

    Thanks

  2. #2
    Russell Jones Guest

    Re: XML Data Islands

    Create a DOMDocument object and use the selectSingleNode method with an XSLT
    query. I haven't tested this exact code, but it should be very close.

    For example, assuming your document looks like this:

    <xml id="MyDataIsland">
    <someelement>
    <someotherelement>
    <targetelement OrderID="214">
    .....

    You could use this code:
    dim xmlDoc
    Set xmlDoc = document.all("MyDataIsland")
    dim aNode
    set aNode = xmlDoc.selectSingleNode("someelement/someotherelement[@OrderID =
    '214']")
    if aNode is Nothing then
    ' error handler here
    end if
    ' do something with aNode.


    "Byron" <byronyoh@aol.com> wrote in message news:3a9552cd$1@news.devx.com...
    >
    > I have a XML Data Island on my page. How can I extract the record I need
    > from the data island. For instance, if I have a data island populated

    with
    > order records and I need to retrieve only the record for a certain order
    > id (ex:OrderId = 214).
    >
    > I'm sure this is probably basic, but I am pretty new to this.
    >
    > Thanks




Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center