DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

+ Reply to Thread
Results 1 to 2 of 2
  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




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
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


Top DevX Stories

Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL


Sponsored Links