Quantcast
Channel: SharePoint 2010 - Development and Programming forum
Viewing all articles
Browse latest Browse all 11571

CamlQuery escape whitespace in FileRef or get ListItem by URL

$
0
0

Hi,

I need to retrieve the ListItems that correspond to the result of a fulltext search on a document library I did with the search.asmx service. The only usable identifier I get from that search seems to be the file's url.

What I'm trying to do now (using the client object model) is a query on the List like this:

<View Scope='RecursiveAll'>
  <Query>
    <Where>
      <Contains>
        <FieldRef Name='FileRef'/>
        <Value Type='Text'>{0}</Value>
      </Contains>
    </Where>
  </Query>
</View>

to get references of the ListItems. For {0} I substitute the end of the url from the first search beginning with the list's title. This works except when the a folder name in the list contains whitespace. Even though the returned list items contain the whitespace in their FileRef field (and I tried searching with exactly the same string) the query returns no results.

How do I need to escape the whitespace? %20 or UrlPathEncode don't seem to work. Or is there another way to get the ListItem by its url?


Viewing all articles
Browse latest Browse all 11571

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>