xsl-list
[Top] [All Lists]

Re: Re: Re: Sibling in the Pattern(match)

2003-11-25 00:53:55

Hey,

I'm sorry for the unindented XML files in my last
email.

The following template can act like a filter since it
does nothing. The attribute "match" here indicate what
needs to be filtered out from the output.

<xsl:template match="*[preceding-sibling::Member[(_at_)name
='acc1']/Member[(_at_)name='acc11']]"/>


Here I wanted to remove(filter out) the element
Member(name attribute is "acc12") and its children
from the output. It is the sibling of the element
Member(name attribute is "acc11").

I assume that the "Member[(_at_)name = 'acc1']/Member[(_at_)name
= 'acc11']" is the path of Member("acc11"). However,
the match only recognized the "Member[(_at_)name ='acc1'].
So, the siblings of it got removed from the output,
which are the Member("acc2") and Member("acc3").

My question is, can we specify the path in the pattern
like I did in the above template? If I want to remove
the Member("acc12") that is the sibling of a Member,
how can I specify in the match pattern?

Thanks


Dongling

Hope this time my source XML is an indented one.


<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



__________________________________
Do you Yahoo!?
Free Pop-Up Blocker - Get it now
http://companion.yahoo.com/

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list