The problem
You are running into one of many inherent problems with using Sitecore Query. The problem is; self
is a reserved word - and therefore /Self Service/ fails.
Workarounds
Now in this instance you can (probably) work around it using some of the suggestions already given. Escape the query like .../#Self Service#/
- but this will only work if you plan to be using a static query where you know the full path in advance.
A way around this limitation would be to reconstruct the query like this:
/sitecore/content/*[@'name='Abcdef']/*[@@name='Sites']/etc etc etc/*[@@name='Self Service']/*
But it's not pretty.
Alternative Solution
Or in the case of your example query, replace the Sitecore Query call entirely, with a call to .GetItem("/sitecore/content/Abcdef/Sites/WXYZ/MNO/Application Contexts/Connect On Demand/Sections/Self Service")
and .GetChildren()
.
References
Reserved words in Sitecore Query:
- ancestor
- and
- child
- descendant
- div
- false
- following
- mod
- or
- parent
- preceding
- self
- true
- xor
Links: