Sitecore XPath
The Sitecore XPath query language is a custom-implemented subset of XPath. The main difference is that instead of this:
"/item[@key='sitecore']/item[@key='content']/item[@key='home']"
you can write:
"/sitecore/content/home"
which is much easier.
Sitecore XPath can be used from the API using the Database.SelectItems(...) or Database.SelectSingleItem(...) methods. In the Sitecore Client you can use the it in the sources for Lookup, ValueLookup and MultiList fields. e.g.
"query:/sitecore/content/home/*"
which yields the subitems of home.
You can also use Sitecore XPath in the new XPath Builder in the Developer Center of 5.3.
The performance in .NET 2.0 is probably not as good as real XPath (.NET 1.0 and 1.1 is another story), but for some tasks you prefer simplicity over speed - rarely, but it happends.
(Update: I have added a bit more explanation)
The reason for this post is really that we made a small addition to the syntax. You can now quote identifiers with hashs (#). Suppose you have an item with the name "News - Corporate". Before you could not address this item as the dash (-) would be interpreted as an operator and not a part of the name. To solve this you can now write:
"/sitecore/content/Home/#News - Corporate#"
Everything between the hashs is considered a name or an identifier.
"/item[@key='sitecore']/item[@key='content']/item[@key='home']"
you can write:
"/sitecore/content/home"
which is much easier.
Sitecore XPath can be used from the API using the Database.SelectItems(...) or Database.SelectSingleItem(...) methods. In the Sitecore Client you can use the it in the sources for Lookup, ValueLookup and MultiList fields. e.g.
"query:/sitecore/content/home/*"
which yields the subitems of home.
You can also use Sitecore XPath in the new XPath Builder in the Developer Center of 5.3.
The performance in .NET 2.0 is probably not as good as real XPath (.NET 1.0 and 1.1 is another story), but for some tasks you prefer simplicity over speed - rarely, but it happends.
(Update: I have added a bit more explanation)
The reason for this post is really that we made a small addition to the syntax. You can now quote identifiers with hashs (#). Suppose you have an item with the name "News - Corporate". Before you could not address this item as the dash (-) would be interpreted as an operator and not a part of the name. To solve this you can now write:
"/sitecore/content/Home/#News - Corporate#"
Everything between the hashs is considered a name or an identifier.
32 Comments:
Hi
Sorry, but from my point of sight you should provide more correct evaluation.
Current(5.2) reflect-style evaluation weak in:
1. I can't use universal XPath extention module (derived from System.Xml.Xsl.XsltContext)
2. I can't use full set of msxsl inline extention support.
3. I must care of element name in sitecore sence.
It'll be cool implement:
1. In library loader - noevaluate option (for XsltContext)
2. Check evaluation mechanism on unrestrict MS-XPath-script support.
Are you agree with me? Or my opinion is wrong?
By Сергій, at 6:40 PM
Is it possible to use a Sitecore Query to feed an RSS Feed from the selected items of a Treelist?
By Anonymous, at 9:27 AM
Ecorptrainings.com provides sitecore in hyderabad with best faculties on real time projects. We give the best online trainingamong the sitecore in Hyderabad.
Classroom Training in Hyderabad India
By raja, at 10:54 PM
wonderful information, I had come to know about your blog from my friend nandu , hyderabad,i have read atleast 7 posts of yours by now, and let me tell you, your website gives the best and the most interesting information. This is just the kind of information that i had been looking for, i'm already your rss reader now and i would regularly watch out for the new posts, once again hats off to you! Thanks a ton once again,
Regards, sitecore training in hyderabad
By Anonymous, at 1:29 AM
hI,
try for project classes also.
Ecorptrainings.com provides sitecore in hyderabad with best faculties on real time projects.
By oraclefusion finance, at 9:40 PM
This post is very well written and also well formatted. impressive nicely developed the sitecore very well..............
R12 Project Accounting Online Training
By Oracle Fusion, at 10:35 PM
Hi,
this post is very interesting and valuable.Thanks for sharing valuable
information.
oracle fusion procurement online training
By oracle procurement, at 2:25 AM
CALFRE is a local search engine for online and classroom training institute. we have online training for the course oracle fusion financials.our oracle fusion financials online training institute Hyderabad, Bangalore, Delhi, Chennai, Kolkata, Pune, Mumbai, Ahmedabad, Gurgon, Noida, India, Dubai, UAE, USA, Kuwait, UK, Singapore, Saudi Arabia, Canada
Oracle fusion Financials Online Training
Oracle Fusion Financials online Training
By Unknown, at 12:23 AM
hi,
this is very interesting topic.thanks for sharing such a nice blog.
oracle fusion HCM online training.
By oracle hcm, at 2:31 AM
This post is very well written and also well formatted. impressive nicely developed the sitecore very well..............
IgoFusion
By oracle34, at 2:28 AM
This post is very informative for everybody. I would like to appreciate your work for good accuracy and got informative knowledge from here nice effort............For More Details about Oracle Fusion Cloud Financials Course Training
By Sandeep SEO, at 1:35 AM
best information.
Laptop repairing
training in hyderabad
By jobs, at 7:12 AM
nice article
Mobile repairing
training
By jobs, at 7:13 AM
This post is very informative for everybody. I would like to appreciate your work for good accuracy...................Please Contact us we are giving best training on Oracle Fusion Procurement Course
By Sandeep SEO, at 11:35 PM
We are happy to announce that Erptree providing Oracle Financials Training.We offer to teach from basic to advanced level and offer in-depth so that one can handle in an easy way. At our ERPTREE, we are having both Online and Classroom Teaching on Oracle Financials application.
Oracle Financials Training
By Unknown, at 12:10 AM
Good information
advanced project accounting training institutes in bangalore,
By amar, at 11:10 PM
awsome blog.
seo training in bangladesh
By Unknown, at 8:18 AM
conventional medicine
A decent blog dependably thinks of new and energizing data and keeping in mind that understanding I have feel that this blog is truly have each one of those quality that qualify a blog to be an one.I needed to leave a little remark to help you and wish you a decent continuation. Wishing you the good luck for all your blogging endeavors.
By Unknown, at 1:54 PM
This is the information that I was looking for. Thanks for the efforts you put to gather such a nice content and posted here.
Oracle Project Accounting Training Institutes in Hyderabad
By Rajesh, at 12:43 AM
Very good post.
All the ways that you suggested for find a new post was very good.
Keep doing posting and thanks for sharing.
By Sannihitha Technologies, at 2:47 AM
Such as very good information promoting content are provided and more skills are improved after referring to that post. To get more details please check our website.
Oracle Fusion SCM Training in Hyderabad
By Unknown, at 2:07 AM
Thanks for sharing this interesting article, it is very interesting and I can’t wait to read more articles about this blog.
Oracle Fusion HCM Training Institute
By Unknown, at 8:42 PM
nice post..Retail Software Solution Chennai
Retail Software Companies in Chennai
ERP Solution Providers in Chennai
By ananthinfo, at 11:49 PM
I have discovered your blog today and I love it!!
You make very beautiful things and your tutorials are very good.
I will add your blog to my list. Congratulations for your works.
quickbooks training in hyderabad
By Sannihitha Technologies, at 3:08 AM
Good Information Thanks for Sharing
Soft Online Provides best online training for Oracle Fusion and EBS R12 Courses
Oracle EBS Training in Hyderabad
Oracle Fusion SCM Training in Hyderabad
Oracle Fusion HCM Training
Oracle Fusion Financials Training
For more info Visit us: https://www.softonlinetraining.com/
By softonlinetraining, at 9:56 PM
Thanks for sharing,you have done a very good job.Keep it up.The content is very interesting and impressive.If you are looking for any online training visit our site.
Best Big Data Hadoop Online Training
By easylearn, at 12:58 AM
Really nice blog. And I suggest you the best online training to Become QA Certified Professional with QA Training Online Course
By srija, at 6:42 AM
Excellent blog I visit this blog it's really awesome. The important thing is that in this blog content written clearly and understandable. The content of information is very informative. We are also providing the best services click on below links to visit our website.
Oracle Fusion HCM Training
Workday Training
Okta Training
Palo Alto Training
Adobe Analytics Training
By Sarika, at 8:49 AM
thanks for sharing nice blog keep posting like this https://snowflakemasters.in/visit it also
By ravi, at 2:08 AM
Impressive blog post
By Dev, at 7:19 PM
Thanks for sharing nice blog keep posting.
Are u Interest to learn GMAT Coaching Online
By GMAT Coaching Online, at 9:31 PM
very useful. Thanks for sharing
By John, at 5:28 AM
Post a Comment
<< Home