Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: [xsl] suppressing only the last PI

From: Abel Braaksma <abel.online@--------->
To:
Date: 1/4/2007 11:21:00 AM
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


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent