473,473 Members | 2,131 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Caching xsl:key with document Source

I was wondering if there was a way to cache a built xsl:key?

I have a custom resolver that returns a DOM when
"document('Assets.xml')" is requested, but the stylesheet takes some
amount of time to generate the key. If we could cache the built key
(along with the DOM?) then we would be one step ahead. I'm using
Xalan 2.5.1.

Note the key is built on the document referenced by the document()
call, NOT the main source document.

I have a stylesheet similar to the following:

<xsl:stylesheet>
<xsl:key name="kAssetById" match="Asset" use="id"/>

<xsl:variable name="assetDoc" select="document('Assets.xml')/Assets"/>

<xsl:template match="Fragment">
<xsl:variable name="assetId" select="@parentAssetId">
<xsl:for-each select="$assetDoc">
<xsl:apply-templates select="key( 'kAssetById', $assetId )">
</xsl:for-each>
</xsl:template>
<xsl:template match="Asset">
[some pretty output]
</xsl:template>
</xsl:stylesheet>

and the input:

<Page>
<Fragment parentAssetId="abc"/>
<Fragment parentAssetId="def"/>
<Fragment parentAssetId="ghi"/>
<Fragment parentAssetId="jkl"/>
</Page>

Thanks,
Darren
Jul 20 '05 #1
0 1804

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Peter Gerstbach | last post by:
Hello, I need help on the new xsl:document element! I'm using XSLT version 1.1 to be able to use the <xsl:document> element, because I need more than 1 output files. I'm using Saxon 6.5.3 My...
1
by: Papastefanos Serafeim | last post by:
I want to use the <xsl:document> XSLT command with xalan, but I get the following error message -------- XSLT Error (javax.xml.transform.TransformerConfigurationException):...
1
by: Daniel | last post by:
in C# how do i transform an xml document with an xsl document when my xml document is a string and my xsl document is a string? the msdn examples only show how to do it with steams and files. in my...
1
by: Marc Scheuner [MVP ADSI] | last post by:
Folks, I'm struggling with XSLT key's and stuff.... anybody out there who *REALLY* understands this stuff??? Okay, my XML file looks something like this (partially): <?xml version="1.0"...
1
by: news.microsoft.com | last post by:
I am writing an XSL file to load a node set with XSL document() function with the syntax as follows: <xsl:variable name="var1" select="document('..\res\xmlfile.xml')/Accounts"/> Unfortunately it's...
1
by: Daniel | last post by:
in C# how do i transform an xml document with an xsl document when my xml document is a string and my xsl document is a string? the msdn examples only show how to do it with steams and files. in my...
3
by: Petterson Mikael | last post by:
Hi, I was running the following in Netbeans 5.5: sing com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl - default JRE XSLT processor. Creating output/NcmiSigTest.java Unsupported...
1
by: David | last post by:
First of all, yes we are still using classic ASP, lol. I have a XSL document that is reading in info from a XML file. I have to display serveral server side dates on the page. Is there anyway to...
0
by: Leira | last post by:
Hi, I have a problem with grouping. My source XML has <record> elements that have a @name and a @group attribute. It looks something like this: <root> <result> <record name="test1"...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.