[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

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


Subject: Re[2]: [xsl] applying code from inside the comment
From: Wendell Piez <wapiez@xxxxxxxxxxxxxxxx>
Date: Tue, 16 Jan 2007 12:53:10 -0500

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@xxxxxxxxxxxxxxxx
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
======================================================================


Current Thread
Keywords
xml