Thanks. I'll try that.
How can one find out what is and is not supported in your XQuery
implementation?
<-----Original Message----->
From: Wayne Loofbourrow
Sent: 2/17/2004 3:05:37 PM
To: email@hidden
Cc: email@hidden
Subject: Re: Retrieving text and anchor nodes
Ah, that's trickier.
Would be easy if our XQuery implementation supported the
preceding-sibling:: axis.
let $strings = $anchors/preceding-sibling::text()
Unfortunately, neither the Jaguar nor the Panther versions support this
axis.
Her is a brute force way to get what you want.
let $doc
:=document("http://www.co-ops.nos.noaa.gov/tides04/tab2ec1b.html")
let $anchors := $doc/A[text()="Predictions"]
let $rawstrings:= tokenize($doc,"")
let $strings :=
for $rs in $rawstrings
let $s1 := if (contains($rs,"")) then substring-after($rs,
"") else $rs
let $s2 := if (contains($s1,"")) then substring-after($s1,
"") else $s1
where not (contains($s2,"<"))
return $s2
return $strings
Wayne
On Feb 16, 2004, at 06:09 PM, wrote:
>
> Thanks. That is close to what I want, but I also want to get the
> preceding sibling text() node. For the first matching anchor in this
> example it should be "Newburyport, Merrimack River 420 48.7' 700 51.9'
> 7.8 9.0 4.2 ".
>
> <-----Original Message----->
> From: Wayne Loofbourrow
> Sent: 2/16/2004 9:04:11 PM
> To: email@hidden
> Cc: email@hidden
> Subject: Re: sherlock-channel-development digest, Vol 1 #180 - 1 msg
>
> Try:
>
> let $nodes :=
> document("http://www.co-ops.nos.noaa.gov/tides04/tab2ec1b.html")/
> A[text()="Predictions"]/@HREF
>
> This says to first extract those A tags whose text content is
> "Predictions" and then grab the HREF attribute from each of them.
>
> Wayne
_______________________________________________
sherlock-channel-development mailing list |
email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/sherlock-channel-development
Do not post admin requests to the list. They will be ignored.
.
_______________________________________________
sherlock-channel-development mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/sherlock-channel-development
Do not post admin requests to the list. They will be ignored.