xsl-list
[Top] [All Lists]

RE: excluding descendants (and all of their descendants as well)

2005-08-31 13:49:19
In XPath 2.0:

(//para)[1]//text except (//system)[2]//text

In 1.0, the effect ($A except $B) can be achieved (painfully) by
$A[count($B) != count(.|$B)]

A more efficient solution (with either version) is to recurse down the child
axis a step at a time, stopping the recursion when you get to the second
system element.

Michael Kay
http://www.saxonica.com/ 

-----Original Message-----
From: Woods, Christopher [mailto:cwoods(_at_)EO(_dot_)Kollmorgen(_dot_)com] 
Sent: 31 August 2005 18:36
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: [xsl] excluding descendants (and all of their 
descendants as well)

How does one find all text elements that are descendants of 
the first para element but exclude any text element that is a 
descendant of the second system element?  

<techinfo>
  <system>
    <descinfo>
      <para-seq>
        <para>
          <text>The quick brown fox jumped over the lazy 
systems engineer.</text>
          <text>Hello world.</text>
          <style>
            <text>In the matter of Jardyce v. Jardyce:</text>
          </style>
          <system>
             <descinfo>
                 <para-seq>
                     <para>
                          <text>Blah, blah, blah...</text>
                           <text>more gibberish.</text>
                           <style>
                               <text>Nasty, Brutish, and 
Short Attorneys at Law</text>
                           </style>
                        </para>
                      </para-seq>
                  </descinfo>
               </system>
            </para>
         </para-seq>
      </descinfo>
   </system>
</techinfo>

Thanks very much.



--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: 
<mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--





--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--