xsl-list
[Top] [All Lists]

RE: apply-template inside xsl:variable returns a documentFragment with a child node tree

2006-02-24 04:13:15
"John P. Flanigan [Software Technology Initiative, Inc.]" wrote:

  <xsl:variable name="thisContent">
    <xsl:apply-templates select="$elementContent">
      <xsl:with-param name="elementName" select="@name"/>
    </xsl:apply-templates>
  </xsl:variable>

  In XSLT 1.0, the value of $thisContent is a RTF.  In XSLT 2.0, it is
a Temporary Tree (so a document node, root of this tree).

The file content.xml has a structure like

  <content>
    <elements>
      <element id="table">
        <caption>Table</caption>
        <description>Name of table in database</description>
        <help href="table.help"/>
      </element>
    </elements>
    ...
  </content>

I would like $thisContent to be equivalent to the single
<element> shown above, when @name = "table".

  In XSLT 2.0, you can use xsl:variable/@as:

    <xsl:variable name="thisContent" as="element(element)">
      ...

  Regards,

--drkm




















        

        
                
___________________________________________________________________________ 
Nouveau : téléphonez moins cher avec Yahoo! Messenger ! Découvez les tarifs 
exceptionnels pour appeler la France et l'international.
Téléchargez sur http://fr.messenger.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>
--~--



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