473,549 Members | 2,719 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

dynamically generated keys in xslt?

I'm new to xslt, and I am attempting to use it to produce a
comma-separated-value file from a large, dynamically-generated data
file formatted in xml (examples of the xml file and my xslt style
sheet follow). It works pretty well, but xsltproc takes an extremely
long time to process the data file when it grows fairly large (>1MB).
I've read that using keys can improve processing time on large
documents, however I don't know the number of key tables required or
which nodes should be placed in the key table until the document must
be processed. I realize that I can use a second "preprocess or" xslt
style sheet to dynamically create the appropriate keys within my own
style sheet, but this approach seems cumbersome and I would prefer to
create the keys dynamically within a single sheet.

Is this possible in xslt, or is this application beyond the scope of
what xslt is designed to do?

Any help greatly appreciated!

- Alex

....

The data file is formatted as follows:

<system version="1.0">
<property_1>
<name>future</name>
<binned_data type="step">
<value ts="0">3.045139 </value>
<value ts="1">3.048611 </value>
<value ts="2">3.052083 </value>...
</binned_data>
</property_1>
<property_2></property_2>...
<system>

I'm using the following xslt style sheet to produce the csv output

<xsl:styleshe et xmlns:xsl="http ://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:output method="text"/>
<xsl:variable name="newline">
<xsl:text>
</xsl:text>
</xsl:variable>

<xsl:template match="/">
<!-- Template for CSV values -->
<xsl:apply-template
select="self::n ode()/descendant::bin ned_data[@type='step'][1]" />
</xsl:template>
<xsl:template match="binned_d ata">
<xsl:for-each select="value">
<xsl:variable name ="i" select="positio n()" />
<xsl:for-each select="//binned_data[@type='step']">
<xsl:value-of select="value[$i]"/><xsl:text>,
</xsl:text>-->
</xsl:for-each>
<xsl:value-of select="$newlin e"/>
</xsl:for-each>-->
</xsl:template>

<!-- suppress everything else -->
<xsl:template match="*"></xsl:template>

</xsl:stylesheet>
Jul 20 '05 #1
0 1585

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

Similar topics

5
1904
by: Mike Mella | last post by:
If I make an RSS feed of my site, am I expected to build and later update the RSS (XML) data by hand as I would any other webpage, or is there some process by which updates to a site are automatically incorporated into the RSS feed once the site itself is updated? Thanks. --Mella
1
1540
by: bjam | last post by:
Hi, I am trying to create a sort of include file into my xsl files such that calling the following template will push these xml tags into my document such that the other xsl files can use these tags to make decisions. In this case I want antother template that is going to create tables be able to call this template in order to get information...
6
1490
by: petermichaux | last post by:
Hi, I am interesting in using PHP to dynamically create an XML document and then use XSLT to transform to XHTML. I have come across two methods for doing this. I made two equivalent examples so you can see what I mean. http://members.shaw.ca/petermichaux/store/XML_XSLT_method.html I am interested in critisim of how I implemented each...
1
2065
by: Amir Eshterayeh | last post by:
Dear Friends I need to change the css file of my aspx files dynamically so users can choose their css file names and when page loads, it read css file name from database. I try to use response.write to write this way: Dim i As Integer = 1 If i = 1 Then Response.Write("<LINK href=""Stylesone.css"" type=""text/css"" rel=""stylesheet"">")...
5
3500
by: Amelyan | last post by:
How can I get state of dynamically created controls (RadioButton, CheckBox, TextBox.Text) on post back when I click submit button? The only way I know is by traversing Response.Form enumberator; Response.Form.GetEnumerator(), etc. while, identifying specific controls by programmatically assigned unique id (e.g. MyButton_AnswerID_123). ...
4
2567
by: ziondreams | last post by:
I'm currently working on a system that will allow our 175+ clients that store their data on our databases to export the data to their systems (via webservice) and also call other web services to update pieces of that data in our systems. What I need help with is the ability to format the XML from the web service differently and dynamically....
4
3634
by: Ed Jay | last post by:
I generate a DHTML page (a medical report) with dynamically generated text based on user input (answers to questions). The page length changes dynamically. I desire that when the page is printed and reaches a specific length, it terminates printing that page, prints a page number, and then begins to print the next page using the same header...
2
2257
by: Andy | last post by:
Hi, I have an ASP.NET webpage that contains an ASP.NET XML control. This control accepts an XSLT stylesheet and XML document which it then uses to render HTML code where the XML control is positioned for the client at the server. This setup works great for an XSLT stylesheet that generates plain HTML tags. But, this doesn't work so well...
6
2542
by: _Who | last post by:
I use the code below to change to a style sheet that has: body { ....
0
7520
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7957
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7470
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7809
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6043
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5368
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5088
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
1
1941
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 we have to send another system
0
763
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.