tag:help-archives.hannonhill.com,2010-02-09:/discussions/velocity-formats/10798-how-do-i-use-xpath-to-exclude-a-certain-folderCascade CMS: Discussion 2014-08-25T20:46:40Ztag:help-archives.hannonhill.com,2010-02-09:Comment/342725502014-08-25T19:59:44Z2014-08-25T19:59:44ZHow do I use xpath to exclude a certain folder?<div><p>Hi Eric,</p>
<p>You should be able to add the following to your XPath expression
to make sure the <strong>_internal</strong> folder is not
included:</p>
<pre>
<code>system-folder[not(contains(name, 'internal'))]</code>
</pre>
<p>Please let me know if you have any questions.</p>
<p>Thanks!</p></div>Ryan Griffithtag:help-archives.hannonhill.com,2010-02-09:Comment/342725502014-08-25T20:00:30Z2014-08-25T20:00:30ZHow do I use xpath to exclude a certain folder?<div><p>Er, my apologies, Eric, I meant to use <strong>path</strong> and
not <strong>name</strong>:</p>
<pre>
<code>system-folder[not(contains(path, 'internal'))]</code>
</pre>
<p>Please let me know if you have any questions.</p>
<p>Thanks!</p></div>Ryan Griffithtag:help-archives.hannonhill.com,2010-02-09:Comment/342725502014-08-25T20:23:46Z2014-08-25T20:27:44ZHow do I use xpath to exclude a certain folder?<div><p>This is the entire line of code that contains my xpath
statement:</p>
<pre>
<code>#set ( $exhibitions = $_XPathTool.selectNodes($contentRoot, "//system-page[dynamic-metadata[name='status' and value='Current'] [not(contains(path, '_internal'))]]") )</code>
</pre>
<ul>
<li>Is my syntax completely wrong? I am also using my xpath
statement to select a dynamic meta-data set.</li>
<li>The folder name, "_internal" starts with an underscore. Is
causing anything to be messed-up?</li>
</ul>
<p>I can't get it to work. I suspect that the syntax is wrong.</p></div>Erictag:help-archives.hannonhill.com,2010-02-09:Comment/342725502014-08-25T20:29:03Z2014-08-25T20:29:03ZHow do I use xpath to exclude a certain folder?<div><p>Hi Eric,</p>
<p>It looks like your XPath statement needs to be tweaked slightly.
When you have a moment, give the following a try and let me know
how it works out:</p>
<pre>
<code>//system-page[not(contains(path, '_internal')) and dynamic-metadata[name='status' and value='Current']]</code>
</pre>
<p>Please let me know if you have any questions.</p>
<p>Thanks!</p></div>Ryan Griffithtag:help-archives.hannonhill.com,2010-02-09:Comment/342725502014-08-25T20:32:56Z2014-08-25T20:32:56ZHow do I use xpath to exclude a certain folder?<div><p>Worked! Thank you. I am gaining a better understanding of
xpath.</p></div>Erictag:help-archives.hannonhill.com,2010-02-09:Comment/342725502014-08-25T20:46:39Z2014-08-25T20:46:39ZHow do I use xpath to exclude a certain folder?<div><p>Thank you for following up, Eric. I am glad to hear the new
XPath did the trick.</p>
<p>I'm going to go ahead and close this discussion, please feel
free to comment or reply to re-open if you have any additional
questions.</p>
<p>Have a great day!</p></div>Ryan Griffith