Subject: RE: [xsl] Can't match node without node()[name(.) syntax From: "Michael Kay" <mike@xxxxxxxxxxxx> Date: Tue, 30 Nov 2004 14:48:29 -0000 |
I asked for a complete example, you've only given us a fragment. You've probably left out the part of your stylesheet or source document that contains the problem. It's remarkable how often people remove the "irrelevant detail" that's actually the bug. For example, you might have another template rule that matches my-relation elements, and that has higher priority than match="my-relation" but lower priority than match="node()[name(.) = 'my-relation']". But that's only a guess. Sometimes these problems are namespace-related: your source document would give clues to that. You haven't shown us that either. But in this case I can't think of any namespace issues that would cause this effect. Michael Kay http://www.saxonica.com/ > -----Original Message----- > From: Robert Soesemann [mailto:rsoesemann@xxxxxxxxxxx] > Sent: 30 November 2004 13:56 > To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx > Subject: [xsl] Can't match node without node()[name(.) syntax > > Help;-( > > I experienced that I cannot match any element in the normal > way of just > Naming the node name. Instead I also need to write > "node()[name(.)='.... > Any ideas why that happens? Could it be the identity template that I > use? > > This works (I see <FOOOOOO/>): > ----------------------------- > <!-- Copy nodes except those affected by other templates --> > <xsl:template match="/ | @* | node()"> > <xsl:copy> > <xsl:apply-templates select="@* | node()"/> > </xsl:copy> > </xsl:template> > > <!-- Match all kiwi-relation elements --> > <xsl:template match="node()[name(.) = 'my-relation']"> > > <FOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO/> > ... > > This doesn't works (I don't see <FOOOOOO/>): > ------------------------------------------- > <!-- Copy nodes except those affected by other templates --> > <xsl:template match="/ | @* | node()"> > <xsl:copy> > <xsl:apply-templates select="@* | node()"/> > </xsl:copy> > </xsl:template> > > <!-- Match all kiwi-relation elements --> > <xsl:template match="my-relation"> > <FOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO/> > ... > Why that?
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
[xsl] Can't match node without node, Robert Soesemann | Thread | Re: [xsl] Can't match node without , Geert Josten |
[xsl] associated sums gouped by dat, dmitrik | Date | Re: [xsl] Can't match node without , Geert Josten |
Month |