xsl-list
[Top] [All Lists]

Re: [xsl] create escaped(?) html of some nodes

2006-10-11 11:08:19
Jan Limpens wrote:

  Hi

2 looks very nice as I can use it in many places. I just don't
understand - how does the node-set() function come into play

  You can dig the archive for "micro-pipelining".  The
concept is very simple: you construct some result, but this
is not the final result, you apply some transformations on
it.  In this case, you construct HTML then you apply
templates that serialize the tree to a string.

  In XSLT 2.0, no problem.  All this is standard.  In XSLT
1.0, when you construct the result, you don't get a
node-set, but a result tree fragment.  It is similiar to a
node-set, but with limitations.  For example, you cannot
apply templates to it.

  Fortunately, all known XSLT 1.0 implementation  (but the
one in FF) provide an extension function, named node-set()
(in different namespaces) to get a node-set from an RTF.  So
if you are using XSLT 1.0, you put the result (the RTF) you
construct in a variable, then:

    <xsl:apply-templates
        select="xx:node-set($rtf)"
        mode="my:serialize"/>

  Regards,

--drkm




















        

        
                
___________________________________________________________________________ 
Yahoo! Mail réinvente le mail ! Découvrez le nouveau Yahoo! Mail et son 
interface révolutionnaire.
http://fr.mail.yahoo.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>
--~--