PHP in Saxon
Added by Anonymous about 15 years ago
Legacy ID: #7774163 Legacy Poster: Saxon Newbie (saxon-newbie)
I'm learning Saxon by building a simple RSS reader for NPR feeds. I've got the out-of-the-box RSS reader working but would like to make it more flexible by adding a GET variable to the URL that can pull NPR feeds by topic. Can PHP be used with Saxon? I'm getting this error: > Error on line 37 column 1 of rss.xq: > XPST0003: XQuery syntax error in #... > $topic = "books"; } ?> let $#: > Unexpected token "let" beyond end of > query Static error(s) in query Can you help me troubleshoot this? I think the problem is with this line -- let $news := doc() -- but I'm not too familiar with Java. Thanks, Saxon newbie - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - declare namespace saxon="http://saxon.sf.net/"; declare option saxon:output "indent=yes"; let $news := doc() let $dateTime := $news/rss/channel/lastBuildDate return
breaking news from {string($news/rss/channel/title)} at {string($dateTime)}{ for $newsItem in $news/rss/channel/item[position() < 7] return
-
{string($newsItem/title)}
{string($newsItem/pubDate)}
{string($newsItem/description)}
Hear the story..
Please register to reply