LISTSERV mailing list manager LISTSERV 15.5

Help for XML-L Archives


XML-L Archives

XML-L Archives


View:

Next Message | Previous Message
Next in Topic | Previous in Topic
Next by Same Author | Previous by Same Author
Chronologically | Most Recent First
Proportional Font | Monospaced Font

Options:

Join or Leave XML-L
Reply | Post New Message
Search Archives


Subject: XSLT default rules
From: Sebastian Jekutsch <[log in to unmask]>
Reply-To:General discussion of Extensible Markup Language <[log in to unmask]>
Date:Thu, 9 Dec 1999 09:24:34 +0000
Content-Type:text/plain
Parts/Attachments:
Parts/Attachments

text/plain (47 lines)


A simple question about XSLT default rules. In the recommendation there is
a default rule as this:

<xsl:template match="text() | @*">
    <xsl:value-of select="."/>
</xsl:template>

So, if you have a XML source

<class name="Fred">
    <method>exit</method>
</class>

and an XSLT sheet

<xsl:template match="Fred">
    <xsl:apply-templates/>
</xsl:template>

it will result -- according to the default rule -- into

Fredexit

Is that right? Or did I get it wrong? I'm a bit surprised because this
behaviour doesn't make any sense to me. I cant think of
any example where this behaviour is useful. Who needs the attribute values?
I'm ok with
<xsl:template match="text()">
    <xsl:value-of select="."/>
</xsl:template>
but not with the @* in it.

O.K., I browsed through the Data Model section in XPath and found the
following:

"Each element node has an associated set of attribute nodes; the element is
the parent of each of these attribute nodes;
however, an attribute node is not a child of its parent element."

Sorry, but that's simply nonsens, isn't it? However, that would solve my
problem.....

Every hint or comment is welcome!

Greetings,
Sebastian
([log in to unmask])

Back to: Top of Message | Previous Page | Main XML-L Page

Permalink



LISTSERV.HEANET.IE

CataList Email List Search Powered by the LISTSERV Email List Manager