[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

[xsl] Re: Re: Sibling in the Pattern(match)


Subject: [xsl] Re: Re: Sibling in the Pattern(match)
From: "Dimitre Novatchev" <dnovatchev@xxxxxxxxx>
Date: Tue, 25 Nov 2003 07:36:19 +0100

"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



Current Thread
Keywords
xml