[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Re: Sibling in the Pattern(match)
"Dongling Ding" <dling61@xxxxxxxxx> wrote in message news:20031124222530.31216.qmail@xxxxxxxxxxxxxxxxxxxxxxxxxx > Thanks! > > It works in your example. But for my example, how can > I filter out the member "acc12"? > > <xsl:template match="*[preceding-sibling::Member[@name > ='acc1']/Member[@name='acc11']]"/> > > It filtered members "acc2" and "acc3" instead of > "acc12" and its child "acc121"? > > Here is the source XML: > > <D> > <Member comment="" name="acc1"> > <Calc>+</Calc> > <Member comment="" name="acc11"> > <Calc>+</Calc> > <Member name="account3_1"/> > </Member> > <Member comment="" name="acc12"> > <Calc>+</Calc> > <Member name="acc121"/> > </Member> > </Member> > <Member comment="" name="acc2"> > <Calc>+</Calc> > </Member> > <Member comment="" name="acc3"> > <Calc>+</Calc> > <Member comment="" name="acc31"> > <Calc>+</Calc> > </Member> > <Member comment="" name="acc32"> > <Calc>+</Calc> > </Member> > </Member> > </D> > I am sorry, but it is not clear at all what you want to achieve. Probably by "filter" you mean "match"? AFAIK "filter" means to remove, not to select, so "to filter" is the opposite of "to match". There are no 'members "acc2" and "acc3' -- there are "Member" elements whose "name" attribute is "acc2" and "acc3". Say what you want to achieve (which you haven't done) and many people in this list will be able to help. More importantly, say what is it you don't understand. Also, if you keep sending unreadable source xml documents, you are intentionally making it very difficult for anyone to understand your questions. The unindented source xml document from your last message may be better represented as the following more readable document: <D> <Member comment="" name="acc1"> <Calc>+</Calc> <Member comment="" name="acc11"> <Calc>+</Calc> <Member name="account3_1"/></Member> <Member comment="" name="acc12"> <Calc>+</Calc> <Member name="acc121"/></Member></Member> <Member comment="" name="acc2"> <Calc>+</Calc> </Member> <Member comment="" name="acc3"> <Calc>+</Calc> <Member comment="" name="acc31"> <Calc>+</Calc> </Member> <Member comment="" name="acc32"> <Calc>+</Calc> </Member> </Member> </D> ===== Cheers, Dimitre Novatchev. http://fxsl.sourceforge.net/ -- the home of FXSL XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|