473,396 Members | 1,921 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,396 software developers and data experts.

XSLT "choose" does not overwrite the innerText of the node.

hiya,
I'm still stuck at this one ;-(

I want to overwrite the "numeric" value of my node with a lookup value.
<xslt>
<xsl:for-each select="PRODUCT-TYPE">
<xsl:choose>
<xsl:when test=".='6'">Bike</xsl:when>
<xsl:when test=".='7'">Car</xsl:when>
<xsl:when test=".='1'">Van</xsl:when>
<xsl:otherwise>UNDEFINED</xsl:otherwise>
</xsl:choose>
<xsl:copy-of select="." />
</xsl:for-each>
</xslt>

<InputXml>
<rows>
<row>
<PRODUCT-TYPE>6</PRODUCT-TYPE>
<PRODUCT-DATE>01/01/2003</PRODUCT-DATE>
</row>
</rows>
</InputXml>

The output is incorrect.
1) Yes, it recognises that the value "6", corresponds to value "Bike"
2) yes, it displays the value "Bike".

However:
1) it pre-pends the value "Bike" to the <PRODUCT-TYPE> node.
2) it does NOT overwrite the value "6" with the "Bike"

here is the output. (please note that the formatting on this page means
that a SINGLE row takes up 2 lines):
<outputXml>
<rows>
<row>Bike<PRODUCT-TYPE>6</PRODUCT-TYPE> <PRODUCT_DATE>30/03/2004</PRODUCT-
DATE>
</row>
</rows>
</outputXml>

I simply want the output to be:
<outputXml>
<rows>
<row>
<PRODUCT-TYPE>Bike</PRODUCT-TYPE>
<PRODUCT_DATE>30/03/2004</PRODUCT-DATE>
</row>
</rows>
</outputXml>

Can someone help?I'm in a desperate hurry to resolve this, and have scoured
the previous posts to see if i could find a similar scenario.

many thanks,
yogi

--
Message posted via http://www.dotnetmonster.com
Nov 12 '05 #1
1 1730
SOLVED.
thanks.
yogi

--
Message posted via http://www.dotnetmonster.com
Nov 12 '05 #2

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

Similar topics

6
by: chris yoker via DotNetMonster.com | last post by:
hiya, i have an xml doc, and I'd like to assign lookup values. Eg, if the "PRODUCT-TYPE" is 6, then I insert "bike" into the innerText. <code> <rows> <row> <PRODUCT-TYPE>6</PRODUCT-TYPE>...
0
by: guido_brasletti | last post by:
Hi, I'm asking for help because I read dozens of threads on this subject, but I still cannot make it work. I'm developing an ASP script (running on a SBS 2k. I'm a beginner with ASP) to use on...
5
by: GS | last post by:
Hi, I have dropdown list bound to a Table, I don't want dropdown list to select first row from a table but rather to display "Choose" and when user clicks it then to display available values. How...
1
by: arnold | last post by:
Hi, I've been knocking my head against the wall trying to create an XSL transform to perform "normalizations" of a set of XML files that have a common structure. % XML file before transform
2
by: john sun | last post by:
Hi, Dear gurus, In the web deployment project, there is one option called "Output Assemblies page". The first choice is "Merge all outputs to a single assembly", According to MSDN, "Merges...
0
by: R2d2Rabeau | last post by:
Hi all, I have an application that manipulates excel files without any problem. The problem is for a certain folder where files are giving me an error: When I check those files Excel ask me to...
2
by: Max2006 | last post by:
Hi, I have a DropDown bound to a DataTable and I would like to add "Please Choose" as the 1st default item. I know that I can add "Please Choose" to the DataTable; but I wonder if I do the same...
1
by: =?Utf-8?B?TWFyayBIb2xsYW5kZXI=?= | last post by:
Hi All, I have registered the steep valley XP Common Controls to the GAC, But I noticed that it does not show up automatically in the Choose Toolbox Items" List. I have to specifically browse to...
5
by: Cirene | last post by:
I have a databound drop down list. What is the easiest way to put the 1st item as "choose one"? Thanks.
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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,...
0
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...
0
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
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,...

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.