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

Re: suppressing only the last PI

Subject: Re: suppressing only the last PI
From: Abel Braaksma <abel.online@xxxxxxxxx>
Date: Thu, 04 Jan 2007 12:19:34 +0100
Re:  suppressing only the last PI
egarrett@xxxxxxxxxxxx wrote:
Thanks for your help. I am trying to process all nodes, though, not just the PIs. It looks as if I change this, it will only grab the PIs that are not specified, and not the other content. Am I interpreting this correctly?

Yes, you are correct, my statements are only about selecting PIs. It looks to me that you are better of using template matching rules instead of trying to select everything in the apply-templates' select attribute. That way, you can easily apply the templates to everything, make one specific match rule and one less specific for catching all others. That way, you let the processor do the work for you. It depends on your current template(s) if this approach will work for you. Here's a sample which only does something special with the last processing instruction:


<xsl:template match="
processing-instruction()
[starts-with(., 'PageEnd_')]
[position() = last()]" >
<xsl:text>LAST</xsl:text>
<xsl:copy />
</xsl:template>


   <xsl:template match="node() | @*">
       <xsl:copy >
           <xsl:apply-templates select="node() | @*" />
       </xsl:copy>
   </xsl:template>

Cheers,
-- Abel
  http://www.nuntia.nl

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.