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: xsl:with-param and xsl:apply-templates


At 25 Oct 2000 09:20 -0400, Norman Walsh wrote:
 > Assuming a test document of "<doc><p>foo</p></doc>", I expect
 > the xsl:message to produce "??? 1, doc, Rubble", but it produces
 > "??? 0, doc, Flintstone". Why?

The sequence of current nodes, templates, and attribute values is:

Current node	Template		       $FRED	   $text-only
---------------------------------------------------------------------
/		match="/"		       -           -
/		name="head.content"	       -	   -
/		Implicit 'title.refx' default  Rubble	   1
<doc>		match="*" mode="title.refx"    Flintstone  0

The 'match="/"' template rule calls the 'head.content' rule, and the
current node stays as '/'.

The 'head.content' rule selects the current node, i.e. '/', and
applies templates in 'title.refx' mode.  The $FRED and $text-only
parameters are passed to the applied templates with values 'Rubble'
and '1', respectively.  Whether or not the next applied templates are
going to use them is a different story.

There is no template rule in 'title.refx' mode that matches '/', so
the processor assumes a default rule that stays in 'title.refx' mode
and applies templates to the children of the current node.  The
implicit default rule doesn't do anything with the $text-only and
$FRED parameters, so they are not passed to the next template.

The child of '/' is '<doc>'.  Staying in 'title.refx' mode, it is
matched by the 'match="*" mode='title.refx' rule.  No parameters were
passed to this rule, so the default values are used, and this template
produces "??? 0, doc, Flintstone".

Regards,


Tony Graham
======================================================================
Tony Graham                            mailto:tgraham@mulberrytech.com
Mulberry Technologies, Inc.                http://www.mulberrytech.com
17 West Jefferson Street                    Direct Phone: 301/315-9632
Suite 207                                          Phone: 301/315-9631
Rockville, MD  20850                                 Fax: 301/315-8285
----------------------------------------------------------------------
  Mulberry Technologies: A Consultancy Specializing in SGML and XML
======================================================================



 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]