Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3331138
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T23:33:24+00:00 2026-05-17T23:33:24+00:00

XmlNodeList list = null; list = xmlResult.SelectNodes(/sitecore /result /item [scWebsitePath=’+sitecoreContextItemPath+’ and scTemplateId=’+templateId+’ and scDateCreated

  • 0
XmlNodeList list = null;
list = xmlResult.SelectNodes("/sitecore
                               /result
                                /item
                                 [scWebsitePath='"+sitecoreContextItemPath+"'
                                  and scTemplateId='"+templateId+"' 
                                  and scDateCreated > '"+publishedFrom+"' 
                                  and scDateCreated < '"+publishedTo+"']");

Above code returns me a list of all “validated” Nodes.
Is it also possible to have xPath check wheter a path ie. “xxx/yyy/zzz/” is part of a Node for example if the given path is “xxx/yyy/zzz/” and i want the items below that path to be returned:

  • “xxx/yyy/zzz/abc/def/ghi” <- will be
    valid
  • “xxx/yyy/zzz/abc/def/ghi/jkl” <- will
    be valid
  • “xxx/yyy/zzz/aaa/aaa/zzz” <- won’t be
    valid

I can access the node Path by doing this:

XmlNode thisScPath = node.SelectSingleNode("scPath");
if (thisScPath == null)
continue;

So i wonder if i can also do something like:

list = xmlResult.SelectNodes("/sitecore
                               /result
                                /item[scWebsitePath='"+sitecoreContextItemPath+"'
                                      and scTemplateId='"+templateId+"'
                                      and scDateCreated > '"+publishedFrom+"'
                                      and scDateCreated < '"+publishedTo+"'
                                      and scPath = '"+scPath+"/*']");

When deleting the invalid Nodes from the list this will save me alot of stress because of bad performance. I can eventually delete the invalid items using a c# string.IndexOf != -1 statement, but I’d like to do this with xPath if possible. Is this possible?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T23:33:24+00:00Added an answer on May 17, 2026 at 11:33 pm

    I think you want to check

      and contains(scPath, 'xxx/yyy/zzz/')
    

    or

      and starts-with(scPath, 'xxx/yyy/zzz/')
    

    in your XPath expression.
    If you use the XPath 2.0 implementation from http://www.xqsharp.com/ then you could even use a regular expression and the matches function.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've got a XmlNodeList which I need to have it in a format that
I'm trying to remove a specific node from a XmlNodeList named listaWidths. This specific
I'm trying to get a list of unanswered questions from the feed , but
I'm trying to get the list of EntityTypes in an EDMX file, and the
I need to get a list of tags that contain a specific attribute. I
i have a class like class CXmlData { String Data1=; String Data2=; List<String> lst=new
I need the most efficient way to filter out Nodes from a XmlNodeList. The
Right now I've got a list box that shows RSS article titles/urls of an
I have an xml file and I am trying to get a list of
How do I get the text that is within an XmlNode? See below: XmlNodeList

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.