From: Dave F. <dav...@gm...> - 2011-07-19 16:05:50
|
I've figured out a messy workaround with the following: Changing the content-type to "text/html" did the unencoding for me, but I'm outputting a CSV file so it's not the ideal solution. I changed the content-type to "text/csv", and now the file loads up in a spreadsheet program as expected, but the & is still in the fields. So, I opted for a brute-force method for now. It's not perfect, so if someone has a more elegant solution that would be great. The xquery code I've opted for as a workaround is as follows (I couldn't figure out how to replace the string with a literal "&" since xquery treats that as a special character and replacing it with "&" put me back where I started): *let $unencoded := replace ($csv-entry, "&", "and")* On Tue, Jul 19, 2011 at 10:13 AM, Dave Finton <dav...@gm...> wrote: > I've spent about and hour trying to figure out this one but it's got me > stumped. I'm dealing with strings stored in our database with HTML-encoded > characters such as "&" and so on, and so if I print these strings out as > content-type "text/plain", the encoded character is outputted, not its > literal value. Is there any way in xquery to decode a string that looks like > this: > > "Brooks & Dunn" > > to > > "Brooks & Dunn" > > -- > David Finton > -- David Finton |