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

RE: Infinite Loop when param empty

Subject: RE: Infinite Loop when param empty
From: "Michael Kay" <mhk@xxxxxxxxx>
Date: Fri, 23 Jul 2004 08:34:54 +0100
param loop
I have not come across a case where it makes sense for a tree-valued
parameter to have any default value other than the empty sequence.
Defaulting it to a node in the principal source document, whether this is
the root node or the outermost element, seems an odd thing to do.

Michael Kay 

> -----Original Message-----
> From: Karl J. Stubsjoen [mailto:karl@xxxxxxxxxxxxxxxxxxxx] 
> Sent: 22 July 2004 23:56
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject: RE:  Infinite Loop when param empty
> 
> 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@xxxxxxxxx]
> Sent: Thursday, July 22, 2004 3:02 PM
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject: RE:  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

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.