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: "Jose R.C. Cruz" <anarakisware@gmail.com>
Date: Wed, 29 Oct 2008 18:14:42 -0700
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:from:to :in-reply-to:content-type:content-transfer-encoding:mime-version :subject:date:references:x-mailer; bh=91aw/uRVLjzZPBnd4zixgzPa+fFH2Uf+dye4Ao8jihA=; b=BRFCCTh/0gmsE6fwpQGK5fMauZzg10wS3vsroBIRvwM4dS7psFBRsdofyfxvgjrbb/ W+tVd5mVssUtOWzLnpwZelX9PCSFa4L3vwNvDMfT/YW4/Sl2F0QE5x5qEAv6GoNssEDj Qc5xh2KoS42aruejEiV7lr6by0iw0bYWyKVvA=
Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:from:to:in-reply-to:content-type :content-transfer-encoding:mime-version:subject:date:references :x-mailer; b=guZZU2HfWn+YmpaKnUaCtYlP46WRTpZ3NQz+19h8Y8nESdQ/TPpDpS0PXHvaq/pBCM ESeTzeXSBK64k9MNEi15WuOC/fPKi6beds5cbTAc/lJ217y2JbmGS1u0RomTk5KvTHo0 k5sM2itTebMUq+2JSZicGpjFmCUvk/LAi6818=
In-reply-to: <261e8110810291605k60fd4335o91c497c98506846d@mail.gmail.com>
References: <DCBC3305-1F79-45CB-B7EB-6C1EDE8B3BF8@gmail.com> <261e8110810291605k60fd4335o91c497c98506846d@mail.gmail.com>
Reply-to: REALbasic NUG <realbasic-nug@lists.realsoftware.com>
Sender: realbasic-nug-bounces@lists.realsoftware.com
2008 Oct 29, 18:01 PST

Thanks for the input. As Samuel V. as pointed out, I need to be very specific about how I name my nodes.

As a side note, the online tutorial at http://www.softwareag.com/xml/library/xql-tutorial.htm states that just typing 'programme' should give the same results as '//programme'. This could be a custom behaviour, but the tutorial was not clear on that point.

At any rate, I have my XQL sample working.  Thanks again!

-----
J.C. Cruz
Freelance Writer
MacTech/REALbasic Developer/Python Magazine
anarakisware-at-gmail-dot-com


On 29 Oct 2008, at 16:05:48, Bart Alcorn wrote:

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>


_______________________________________________
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>