Subject: RE: [xsl] "*|@*|text()" vs. "node()" From: "Michael Kay" <mhkay@xxxxxxxxxxxx> Date: Fri, 5 Oct 2001 11:00:40 +0100 |
node() is short for child::node(), it doesn't match attributes, because they aren't the child of anything. Mike Kay > -----Original Message----- > From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx > [mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx]On Behalf Of > Jorg Heinicke > Sent: 04 October 2001 13:49 > To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx > Subject: [xsl] "*|@*|text()" vs. "node()" > > > I want to shorten/improve my XSL-code, but a problem occures. > Until now I > had a stylesheet like the following: > > <xsl:template match="*|@*|text()"> > <xsl:copy> > <xsl:apply-templates select="*|@*|text()"/> > </xsl:copy> > </xsl:template> > > <xsl:template match="@href"> > <xsl:attribute name="href"> > <xsl:choose> > <!-- specifying the value --> > </xsl:choose> > </xsl:attribute> > </xsl.template> > > <!-- some more templates --> > > Now I changed "*|@*|text()" to "node()" (both <xsl:template> and > <xsl:apply-templates>) and I thought it should make no > differences, because > the original XML contains only elements, attributes and text-nodes. > But now I get an error-message: > > href has an illegal attribute: {1} > > Is this a bug in Xalan, because the priority of the templates > doesn't work > correctly anymore? Or what can be the problem? > > Thanks in advance, > > Joerg > > -- > > System Development > VIRBUS AG > Fon +49(0)341-979-7435 > Fax +49(0)341-979-7409 > joerg.heinicke@xxxxxxxxx > www.virbus.de > > > XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list > XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: [xsl] "*|@*|text()" vs. "node(), Michael Kay | Thread | [xsl] Re: Re: XSLT Tree Model, Dimitre Novatchev |
RE: [xsl] testing for existence of , Michael Kay | Date | RE: [xsl] "*|@*|text()" vs. "node(), Michael Kay |
Month |