[Xesam] special characters in query string
Mikkel Kamstrup Erlandsen
mikkel.kamstrup at gmail.com
Mon Aug 11 12:32:32 PDT 2008
2008/8/11 Michael Albinus <michael.albinus at gmx.de>:
> "Mikkel Kamstrup Erlandsen" <mikkel.kamstrup at gmail.com> writes:
>
>> So, are you using any client libs, or just the raw dbus interface? And
>> what version of strigi are you running?
>
> arthur:~> strigidaemon --version
> strigidaemon 0.5.11
> Copyright (C) 2006-2007 Jos van den Oever and others
>
> No library, I use raw D-Bus communication. See D-Bus monitor output:
>
> ---
> method call sender=:1.65 -> dest=:1.66 path=/org/freedesktop/xesam/searcher/main; interface=org.freedesktop.xesam.Search; member=NewSearch
> string "strigisession1804289383"
> string "<?xml version="1.0" encoding="UTF-8"?>
> <request xmlns="http://freedesktop.org/standards/xesam/1.0/query">
> <userQuery>
> "<michael.albinus at gmx.de>"
> </userQuery>
> </request>"
> method return sender=:1.66 -> dest=:1.65 reply_serial=39
> string "strigisearch1957747793"
> method call sender=:1.65 -> dest=org.freedesktop.DBus path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=AddMatch
> string "type='signal',interface='org.freedesktop.xesam.Search',member='HitsAdded',sender=':1.66',path='/org/freedesktop/xesam/searcher/main',arg0='strigisearch1957747793'"
> method call sender=:1.65 -> dest=org.freedesktop.DBus path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=AddMatch
> string "type='signal',interface='org.freedesktop.xesam.Search',member='SearchDone',sender=':1.66',path='/org/freedesktop/xesam/searcher/main',arg0='strigisearch1957747793'"
> method call sender=:1.65 -> dest=:1.66 path=/org/freedesktop/xesam/searcher/main; interface=org.freedesktop.xesam.Search; member=StartSearch
> string "strigisearch1957747793"
> method return sender=:1.66 -> dest=:1.65 reply_serial=42
> signal sender=:1.66 -> dest=(null destination) path=/org/freedesktop/xesam/searcher/main; interface=org.freedesktop.xesam.Search; member=SearchDone
> string "strigisearch1957747793"
> ---
>
> When I use beagle-xesam-adaptor, I receive an error:
>
> ---
> method call sender=:1.65 -> dest=:1.68 path=/org/freedesktop/xesam/searcher/main; interface=org.freedesktop.xesam.Search; member=NewSearch
> string "0"
> string "<?xml version="1.0" encoding="UTF-8"?>
> <request xmlns="http://freedesktop.org/standards/xesam/1.0/query">
> <userQuery>
> "<michael.albinus at gmx.de>"
> </userQuery>
> </request>"
> error sender=:1.68 -> dest=:1.65 error_name=System.Xml.XmlException reply_serial=64
> string "expected '>' (3E) but found '@' (40) Line 4, position 23."
Good, this explains it I think. Beagle does the correct thing,
complaining that the query is not well formed XML. From
http://xesam.org/main/XesamSearchAPI#NewSearch, we have: "...if there
are errors parsing the query_xml parameter an error should be thrown".
As said earlier, you need to XML escape what you stick inside the
userQuery tags. In this case:
"<" --> "<"
">" --> ">"
Cheers,
Mikkel
More information about the Xesam
mailing list