[xquery-talk] escape-uri() not escaping special characters

Lars Burgess lars.burgess at glu.com
Wed Jul 6 17:27:13 PDT 2005


Thanks for your help; it was my understanding that escape-uri would
encode the "browser-friendly" uri string automatically. The uri loads
fine now without using the escape-uri function, if all "&"'s are
replaced by "&".

 

-Lars

 

________________________________

From: talk-bounces at xquery.com [mailto:talk-bounces at xquery.com] On Behalf
Of Michael Kay
Sent: Wednesday, July 06, 2005 3:09 PM
To: Lars Burgess; talk at xquery.com
Subject: RE: [xquery-talk] escape-uri() not escaping special characters

 

As with XML, an ampersand in XQuery needs to be written as &

 

Michael Kay

http://www.saxonica.com/

	 

	
________________________________


	From: talk-bounces at xquery.com [mailto:talk-bounces at xquery.com]
On Behalf Of Lars Burgess
	Sent: 06 July 2005 19:25
	To: talk at xquery.com
	Subject: [xquery-talk] escape-uri() not escaping special
characters

	Hello,

	 

	I am having trouble getting the fn:escape-uri() function to work
properly for a particular uri. I have the following code in a xquery
that parses news information:

	 

	for $g in
fn:doc(concat(fn:escape-uri("http://feeds.foxsports.com/feedout/content?
partnerKey=RijXtgaXlG0&showData=1&noHtml=1&rankTypeCode=35&number=50&ran
kCategoryId=", true()), $category))//content

	 

	When I run the XQuery, it gives the following error message:

	 

	Error on line 6 column 40 of file:/h:/fsmpro/mlb_news.xquery:

	  XPST0003: XQuery syntax error in
#...35&number=50&rankCategoryId=",#:

	    No closing ';' found for entity or character reference

	 

	It appears that the special characters in the URI are not being
escaped at all. Is there some other step to getting this to work? Or is
there a problem with the code? I am using saxon engine v8.4.

	 

	Thanks,

	Lars

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://xquery.com/pipermail/talk/attachments/20050706/c6173a8d/attachment.htm


More information about the talk mailing list