This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

RE: "*|@*|text()" vs. "node()"


instead of <xsl:apply-templates select="*|@*|text()"/>, I think you just
want <xsl:apply-templates> otherwise, you're applying the templates to the
children of whatever matches the template first and not getting the original
match.  Also, I think that it's going to match everything so all the
children 3 levels nested and below are going to be repeated.  As far as the
attribute, I don't believe you can have <xsl:choose> as a child of
<xsl:attribute>.  Also, you can't have <xsl:attribute> without an opening
element before it..  Also, I don't know if it would make a difference, but
try <xsl:template match="*/@href"> instead of simply match="href"


-----Original Message-----
From: owner-xsl-list@lists.mulberrytech.com
[mailto:owner-xsl-list@lists.mulberrytech.com]On Behalf Of Jörg Heinicke
Sent: Thursday, October 04, 2001 7:49 AM
To: xsl-list@lists.mulberrytech.com
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@virbus.de
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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]