[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: <xsl:template><xsl:value-of/></xsl:template>

Subject: RE: <xsl:template><xsl:value-of/></xsl:template>
From: "G. Ken Holman" <gkholman@xxxxxxxxxxxxxxxxxxxx>
Date: Mon, 11 Jan 1999 12:53:10 -0500
xsl template match
At 99/01/11 09:35 +0000, Paul Spencer wrote:
>I thought it was some sort of magic incantation to the IE5
>...
>If there is another reason, I, too, would love to know it
>...
>Paul Spencer
>
>-----Original Message-----
>From: owner-xsl-list@xxxxxxxxxxxxxxxx
>[mailto:owner-xsl-list@xxxxxxxxxxxxxxxx]On Behalf Of Kaiman, Charlie
>Sent: 08 January 1999 19:20
>To: 'XSL Listserv'
>Subject: <xsl:template><xsl:value-of/></xsl:template>
>
>
>Can someone tell me what this line does in an XSL style sheet?
>
>"<xsl:template><xsl:value-of/></xsl:template>"


>From XSL Section 2.7.13, <xsl:value-of> extracts text from the source tree.
 The entire text data content of the node (in parse order) is the text from
the source tree.

To illustrate this, I've written a stylesheet for both XT and IE5b2, and
the results are noted below.

Interestingly, MSXSL accepts no specification of a match attribute and
appears to match on everything when no value is specified, yet Appendix A
of the WD requires the attribute:

<!ELEMENT xsl:template %template;>
<!ATTLIST xsl:template
  match %pattern; #REQUIRED
  priority %priority; #IMPLIED
  mode NMTOKEN #IMPLIED
  %space-att;
>

Looking at the XT and IE5b2 results, I see that both are correctly
interpreting that the value-of is calculated from of *all* of the
subelements of the node, not triggering template rules on subelements (see
element <testb>).  

Also note that with no match attribute IE5b2 will process *all* nodes (the
output shows the processing of the XML Declaration), while with the
match="*" attribute the WD Production [12] is documented that "*"
represents elements, so therefore the IE5b2 no-attribute interpretation
can't be documented as "*".

I hope this helps.

............ Ken



T:\FTEMP>type test.xml
<?xml version='1.0'?>
<test>
<testa>Value for a</testa>
<testb>Value for b
<testb1>Value for b1</testb1>
<testb2>Value for b2</testb2>
</testb>
<testc>Value for c</testc>
</test>
T:\FTEMP>rem W3C Stylesheet:

T:\FTEMP>type test.xsl
<?xml version='1.0'?>
<xsl:stylesheet
       xmlns:xsl="http://www.w3.org/TR/WD-xsl"
       xmlns="http://www.w3.org/TR/REC-html40"
       result-ns="">

<xsl:template match="*">[[<xsl:value-of select="name(.)"/>[<xsl:value-of
select="."/>]]]</xsl:template>

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

</xsl:stylesheet>
T:\FTEMP>call xsl test.xml test.xsl test.htm
T:\FTEMP>rem W3C Results:

T:\FTEMP>type test.htm
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
[[testa[Value for a]]]
[[testb[Value for b
Value for b1
Value for b2
]]]
[[testc[Value for c]]]


T:\FTEMP>rem IE5b2 Stylesheet:

T:\FTEMP>type test.msxsl
<?xml version='1.0'?>
<xsl:stylesheet
       xmlns:xsl="http://www.w3.org/TR/WD-xsl"
       xmlns="http://www.w3.org/TR/REC-html40"
       result-ns="">

<xsl:template>[[<xsl:nodeName/>[<xsl:value-of/>]]]</xsl:template>

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

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

</xsl:stylesheet>
T:\FTEMP>call msxsl test.xml test.msxsl test.mshtm
T:\FTEMP>rem IE5b2 Results:

T:\FTEMP>type test.mshtm
[[xml[]]][[testa[Value for a]]][[testb[Value for b Value for b1Value for
b2]]][[testc[Value for c]]]

T:\FTEMP>


--
G. Ken Holman         mailto:gkholman@xxxxxxxxxxxxxxxxxxxx
Crane Softwrights Ltd.  http://www.CraneSoftwrights.com/s/
Training:   http://www.CraneSoftwrights.com/s/schedule.htm
Resources: http://www.CraneSoftwrights.com/s/resources.htm
Shareware: http://www.CraneSoftwrights.com/s/shareware.htm
Next XSL Training (see training link):   WWW8 - 1999-05-11


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.