473,320 Members | 2,052 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

weird attribute problem

Hi there,
1. I have the following XSL:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"version="1.0">
<xsl:output method ="xml" />
<xsl:param name="sort-id" select="'Last Name'"/>
<xsl:param name="sort-order" select="'ascending'"/>
<xsl:param name="sort-type" select="'text'"/>
<xsl:template match="@* | node()">
<xsl:copy>
<xsl:apply-templates select="@* | node()" />
</xsl:copy>
</xsl:template>
<xsl:template match="DATATABLE[@ID='TARGET']">
<xsl:copy>
<xsl:apply-templates select="@* | ROW">
<xsl:sort select="COLUMN[@ID = $sort-id]/@VALUE"
data-type="{$sort-type}" order="{$sort-order}" lang="en" />
</xsl:apply-templates>
</xsl:copy>
</xsl:template>
</xsl:stylesheet>
2. When I apply this to an XML of the form:
<DATATABLES>
<DATATABLE ID="TARGET">
<ROW ID="0">
<COLUMN>...</COLUMN>
<COLUMN>...</COLUMN>
</ROW>
<ROW ID="1">... </ROW>
<ROW ID="2">
<COLUMN>...</COLUMN>
......
</ROW>
</DATATABLE>
<DATATABLE ID="something else">....
</DATATABLE>
</DATATABLES>
I get the desired result, all good! BUT if I change the sort-order
param to "'descending'", my resulting xml loses the ID="TARGET"
attribute!!!? How can I fix this behaviour and why is it happening?
Thank you.

Nov 11 '05 #1
0 997

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

Similar topics

6
by: Randy Jackson | last post by:
Hello everyone. First of all, apologies in advance if this is a question that gets asked all the time. I tried to search, but wasn't really sure exactly what to search for. Anyway, here's...
3
by: Gonçalo Rodrigues | last post by:
Hi, I use the unittest module for testing a given module's functionality, by lumping several test classes and then at the end a simple if __name__ == "__main__": unittest.main() In one of...
0
by: Jurrie | last post by:
Hi all, I have a XML-document which i want to transform into PDF with apaches FOP. In my XML document i have <href> tags that are links to either a chapter in the document or to a place on the...
7
by: LRW | last post by:
Below I'll paste my CSS and the HTML in question. But what's happening is, I'm trying to establish a link behavior for a class that's separate from the normal link class. I've established a: 's...
11
by: Les Paul | last post by:
I'm trying to design an HTML page that can edit itself. In essence, it's just like a Wiki page, but my own very simple version. It's a page full of plain old HTML content, and then at the bottom,...
1
by: Constandinos | last post by:
Hi I have a very weird problem and very difficult to solve. There is a solution that I already know, but that is too time consuming and I need a quick answer if there is one I have a big...
1
by: fd123456 | last post by:
The TextBoxes in ASP have a weird behaviour when it comes to handling carriage returns. You can try this : Create a Webform. On it, place a textbox, set it's TextMode property to MultiLine....
1
by: Alan Silver | last post by:
Hello, I am just converting a 1.1 web site to use version 2.0 of the framework and have run into a weird problem trying to add a skin file. I set up a theme, and moved the CSS file in there,...
0
by: M.Selvakumar | last post by:
Hi, I have a weird problem in checkbox.In my page, When i move mouse from one textbox to other suddenly the chechbox's text is selected and the typed chracters are attached to the checkbox...
2
by: M.Selvakumar | last post by:
Hi, I have a weird problem in checkbox.In my page, When i move mouse from one textbox to other suddenly the chechbox's text is selected and the typed chracters are attached to the checkbox...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.