xsl-list
[Top] [All Lists]

Sibling in the Pattern(match)

2003-11-23 19:27:47
Hi,

I want to perform a filering out transformation to a
source file. I copy most things, but leave out specfic
parts.

The left out part can be done like this:

<xsl:template match="execluded-nodes">
"do nothing"
</xsl:template>

<xsl:template match="child::Member[(_at_)name ='acc1']"/>

There is a problem with this approach. It seems like
you only can specify "child" or "attribute" in the
match pattern.

What can I do if I want to execlude all the nodes
having the same level as a selected nodel?

For example, the selected node is "acc11", all the
nodes having the same level like "acc12", "acc31", and
"acc32" will be also included

What can I do if I want to execlude all the sibling
nodes of a selected node?

For example, the selected node is "acc11", the "acc12"
will be also included".


Is there any good thought on this? Thanks

Dongling


(Source XML File)
<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="account3_1"/>
                </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>





__________________________________
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