xsl-list
[Top] [All Lists]

Re: Copy all preceding-sibling except...

2005-02-01 15:39:29
Becky,

At 04:24 PM 2/1/2005, you wrote:
I now have a situation where I take

<RootEle>
        <Alphabet>
                <A/>
                <B/>
                <D/>
                <Special/>
                <Break/>
                <H/>
        </Alphabet>
</RootEle>

What I want to come out with is:
<RootEle>
        <Alphabet>
                <A/>
                <B/>
                <D/>
                <Break/>
        </Alphabet>
</RootEle>

I've been playing with the solution to my previous problem to see if I
can work with it to solve this one, but I am unable figure out how to
copy all the preceding-siblings and exclude any nodes that match
"Special" at the same time.

To leave "Special" elements out, assuming the context node is your Break, use

preceding-sibling::*[not(self::Special)]

in XSLT 1.0.

Cheers,
Wendell


======================================================================
Wendell Piez                            
mailto:wapiez(_at_)mulberrytech(_dot_)com
Mulberry Technologies, Inc.                http://www.mulberrytech.com
17 West Jefferson Street                    Direct Phone: 301/315-9635
Suite 207                                          Phone: 301/315-9631
Rockville, MD  20850                                 Fax: 301/315-8285
----------------------------------------------------------------------
  Mulberry Technologies: A Consultancy Specializing in SGML and XML
======================================================================


--~------------------------------------------------------------------
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>
--~--



<Prev in Thread] Current Thread [Next in Thread>