[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re[3]: applying code from inside the comment

Subject: Re[3]: applying code from inside the comment
From: Alexey Nickolaenkov <nikolaenkov@xxxxxxxxxxxx>
Date: Wed, 17 Jan 2007 00:18:19 +0300
Re[3]:  applying code from inside the comment
Tuesday, January 16, 2007, 8:53:10 PM, you wrote:
WP> That's a pretty nice example of micropipelining.
Thank you.

WP> It could be tightened up a bit:
WP> 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>

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

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

Of course it can, but I apply this template against comments of which
xml validity I'm not so sure. Therefore if I do something like

<xsl:variable name="comment" select="saxon:parse(.)"/>

and my comment will contain
<!--
<a>
   some node set
</a>
<b>
   some other nodeset
</b>
..
-->

I'll receive document has no root element error. That's why
this pipelined workaround is applied.

-- 
Alexey                            mailto:alexey.nikolaenkov@xxxxxxxxxxxx

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.