xsl-list
[Top] [All Lists]

Re[2]: [xsl] applying code from inside the comment

2007-01-16 10:54:26
Alexey,

That's a pretty nice example of micropipelining.

It could be tightened up a bit:

At 12:12 PM 1/16/2007, you wrote:
<xsl:template match="//comment()[contains(.,'drive_panel')]">
    <xsl:variable name="comment">
        &lt;comment&gt;
                <xsl:value-of select="."/>
        &lt;/comment&gt;
    </xsl:variable>

    <xsl:variable name="node-set" select="saxon:parse($comment)" />
    <xsl:apply-templates select="$node-set"/>
</xsl:template>

<xsl:template match="comment">
        <xsl:apply-templates select="node() except ./text()"/>
</xsl:template>

<xsl:template match="comment()[contains(.,'drive_panel')]">
    <xsl:variable name="comment" select="saxon:parse(.)"/>
    <xsl:apply-templates select="$comment except $comment/text()"/>
</xsl:template>

Note: untested. You might have to try "saxon:parse(string())".

Cheers,
Wendell



======================================================================
Wendell Piez                            
mailto:wapiez(_at_)mulberrytech(_dot_)com
Mulberry Technologies, Inc.                http://www.mulberrytech.com
17 West Jefferson Street                    Direct Phone: 301/315-9635
Suite 207                                          Phone: 301/315-9631
Rockville, MD  20850                                 Fax: 301/315-8285
----------------------------------------------------------------------
  Mulberry Technologies: A Consultancy Specializing in SGML and XML
======================================================================


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