xsl-list
[Top] [All Lists]

RE: Infinite Loop when param empty

2004-07-22 15:56:22
Thanks for the input on the "Infinite Loop".
Is it good practice to explicitly ask for the top level element in the
select property?  So, the xml source being passed in may look like:

<XML_SOURCE>
  <XML_DATA/>
  <XML_DATA/>
  <XML_DATA/>
</XML_SOURCE>

And the parameter looking like:
<xsl:param name="ENTRY_TEMPLATE" select="XML_SOURCE"/>

Karl



-----Original Message-----
From: Michael Kay [mailto:mhk(_at_)mhk(_dot_)me(_dot_)uk]
Sent: Thursday, July 22, 2004 3:02 PM
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: RE: [xsl] Infinite Loop when param empty


I have a param which is populated with an XML source.

The paramter is declared like this:
<xsl:param name="ENTRY_TEMPLATE" select="/"/>

My top level match is:
<xsl:template match="/">

Within this template rule I apply the following:
<xsl:apply-templates select="$ENTRY_TEMPLATE"/>

If the param ENTRY_TEMPLATE is not set, I end up with an
infinite loop.  Is
this normal behaviour?  I'm guessing that maybe it is bad practice to
declare the param as I have.

Yes, the system is behaving correctly - it is doing exactly what you asked
it to do. And yes, it might be a good idea to ask it to do something
different!

Michael Kay


--+------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--+--




<Prev in Thread] Current Thread [Next in Thread>