View Single Post
  #5 (permalink)  
Old July 28th, 2009, 12:26 PM
baseliner baseliner is offline
Authorized User
Points: 102, Level: 2
Points: 102, Level: 2 Points: 102, Level: 2 Points: 102, Level: 2
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jul 2009
Posts: 23
Thanks: 5
Thanked 0 Times in 0 Posts
Default

Thanks for pointing this out, Michael. I was trying to avoid XSLT since I need to perform this logic multiple times in the for loop so I was trying to avoid the overhead associated with loading an XSLT file from disk every time (my application's users are very sensitive to time it takes to execute). Not sure if there's a way to load the XSLT file just once prior to the for loop and then use it from memory within the for loop?

Also, the following XSLT code doesn't seem to work for this (I"m getting empty output, I think I'm doing something silly):

Code:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0">

    <xsl:template match="/">
        <xsl:apply-templates select="*"/>
    </xsl:template>
    
    <xsl:template match="*" mode="copy">
        <xsl:copy>
            <xsl:copy-of select="@*"/>
            <xsl:apply-templates mode="copy"/>
        </xsl:copy>
    </xsl:template>
    
    <xsl:template match="D" mode="copy"/>
</xsl:stylesheet>
I haven't programmed with XQuery yet but it looks like it's inline code (no external file needed) so I'll look into this more.. How does it compare with XSLT in terms of performance (given that the XSLT file has to be loaded from disk)?

Thanks!
Reply With Quote