realbasic-nug
[Top] [All Lists]

Re: Trying to get XQL to work

To: "REALbasic NUG" <realbasic-nug@lists.realsoftware.com>
Subject: Re: Trying to get XQL to work
From: "Bart Alcorn" <bart.alcorn@gmail.com>
Date: Wed, 29 Oct 2008 19:05:48 -0400
Authentication-results: mx.google.com; spf=neutral (google.com: 74.124.194.228 is neither permitted nor denied by best guess record for domain of realbasic-nug-bounces@lists.realsoftware.com) smtp.mail=realbasic-nug-bounces@lists.realsoftware.com; dkim=neutral (body hash did not verify) header.i=@gmail.com
Delivered-to: listarchive@realsoftware.com
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:in-reply-to:mime-version:content-type:references; bh=oDt4/4WKfU/tJrqzoAOfcwThwK/aPqEEEzIKak/tkqA=; b=QkudMGbteeGo4RogeeaDQWLepTyJsD86bIt0W85djOh7vhGtrAvas/l9EKIankbdv2 PwptnfLTmTTmISdboZLy53JRbpPquE4/xUQtKV3z+GNqP26Y77/ttE4PgSz/FJKICOjF apnZ6ZqC/AjBhyJeBb//R51E3KcmcthgSfX7Q=
Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version :content-type:references; b=rkO+pzVhljVAY3bS7yJ3r0+mKmei/4Sq4gL8xhxr+CaYdr9DgjS8pUMDwRAeMCCSwN s40/NtrWYRM8C5Gtd6tXS3tMtUbyBD2ad6Ge08SCuif7+0eyQTX+eo1vUPhiZlSbd/T6 u6Xftks1EEMaacZs8e10+kKwbOTjRUpQ1a3iw=
In-reply-to: <DCBC3305-1F79-45CB-B7EB-6C1EDE8B3BF8@gmail.com>
References: <DCBC3305-1F79-45CB-B7EB-6C1EDE8B3BF8@gmail.com>
Reply-to: REALbasic NUG <realbasic-nug@lists.realsoftware.com>
Sender: realbasic-nug-bounces@lists.realsoftware.com
The "programme" node is a child of the "radio" node, so you need to drill
down the tree in order to find it.
There are two major ways to do this:

1. use the descendant operator ("//"), which will find the target node
anywhere in the tree
i.e. tXML.xql("//programme")

2. set a base node, and then query it
// no error checking here at all for simplicity's sake!
dim radioNode as XMLNode
radioNode = xdoc.xql( "radio" ).Item(0)   // no error checking to see if the
item exists!!
// radioNode is now an XMLNode

dim programmeList as XMLNodeList
programmeList = radioNode.xql( "programme" )

// bare minimal error checking
dim programme as XMLNode
if programmeList.Length > -1 then programme = programmeList.Item(0)

Hope this helps!

-- 
Bart Alcorn
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>


<Prev in Thread] Current Thread [Next in Thread>