XSL Templage Rule

I have a DTD that looks like that:

and sitting on a GROUP-Element I need an <xsl:apply templates select="… -rule getting me all the childs except the SEGMENT number 1.

I triede someting like that:

<xsl:apply-templates select="*[not(SEGMENT[1])]"/>

but it doesn’t give me the desired effect. Can anybody tell me what I’m missing here?

Thanks in advance.

I hope you’re not still waiting for a response, but I don’t like to see the question there with no answer, so here it is anyway.

One approach is to select everything in the apply-templates, and then define a template rule for SEGMENT[1] that does nothing. To do this you may have to use a special mode, since there’s probably another apply-templates that does want to process SEGMENT[1].

A more direct solution is

select="[not(self::SEGMENT)] | SEGMENT[position() > 1]“

The selects all the nodes that aren’t SEGMENTs, together with all the SEGMENTs after the first.

At XPath 2.0 you’ll be able to write

select=” except SEGMENT[1]"

but you’ll have to wait a bit for that!

Mike Kay