xsl-list
[Top] [All Lists]

RE: [xsl] Problem with xsl:template using XSLT 1.0

2007-12-03 08:24:35
Florent,

That's a decent philosophy, but the real-world problem is that you
usually have large chunks of data within your source document that you
don't want in your output. If you apply-templates to all children
indiscriminately when you only actually want to process a certain subset
of child nodes, then you have a high probability that the built-in
templates will catch that unwanted data, resulting in unwanted text
everywhere in your result, interspersed with the text you did want.

Also, as I had said in the previous response, template match patterns
must be context-free. If you need to select a node-set that requires a
context, you're limited to apply-templates.

~ Scott


-----Original Message-----
From: Florent Georges [mailto:lists(_at_)fgeorges(_dot_)org] 
Sent: Sunday, December 02, 2007 8:40 AM
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: Re: [xsl] Problem with xsl:template using XSLT 1.0

Scott Trenda wrote:

  Hi

Remember that your <xsl:template/> elements should match
fairly generically (match="player" in this case), and your
<xsl:apply-templates/> elements should be where you narrow
down your selection.

  Weird, personnally I would have said the opposite.

  A template rule focuses on how dealing with the current
node, and delegates how dealing with other nodes to other
rules.  One natural way (but there are others) to handle
complexity is then to apply templates to all children and
let template rules to handle differently different matches.

  Off course, that supposes that there is a specific place
in a template rule to put an instruction "apply templates to
all children."

  Regards,

--drkm






















 
________________________________________________________________________
_____ 
Ne gardez plus qu'une seule adresse mail ! Copiez vos mails vers Yahoo!
Mail 


--~------------------------------------------------------------------
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>
--~--


--~------------------------------------------------------------------
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>
--~--