Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XSLT
| Search | Today's Posts | Mark Forums Read
XSLT General questions and answers about XSLT. For issues strictly specific to the book XSLT 1.1 Programmers Reference, please post to that forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XSLT section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 18th, 2005, 07:55 AM
Registered User
 
Join Date: Feb 2005
Location: Courdimanche, , France.
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default easy XSLT question

Hello

I have an easy question for a XSL users. I have this xml

<text>You have to pay<amount>18 000</amount >dollars</text>

And I would like to transform it like this :

<data>You have to pay 18 000 dollars</data>


As you can see, it's not so hard :) but the tutorial I hve read, did not help me a lot.

Thank you
Seb


 
Old February 18th, 2005, 09:47 AM
Friend of Wrox
 
Join Date: Oct 2003
Location: Chennai, TamilNadu, India.
Posts: 326
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to Santhi Send a message via MSN to Santhi
Default

U can use <xsl:value-of select="text"> to get the output


 
Old February 18th, 2005, 11:28 AM
Registered User
 
Join Date: Feb 2005
Location: Courdimanche, , France.
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks it works, and if I want to do this
<text>You have to pay<amount>18 000</amount >blablabla</text>

And I would like to transform it like this :

<data>You have to pay 18 000 $ blabla</data>
I added th "$" to amount.

Any ideas?
Seb


 
Old February 18th, 2005, 11:43 AM
Authorized User
 
Join Date: Jul 2004
Location: Oxford, , United Kingdom.
Posts: 53
Thanks: 0
Thanked 0 Times in 0 Posts
Default

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

    <xsl:template match="text">
        <data>
            <xsl:apply-templates />
        </data>
    </xsl:template>

    <xsl:template match="amount">
            <xsl:apply-templates /> $
    </xsl:template>

</xsl:stylesheet>





Similar Threads
Thread Thread Starter Forum Replies Last Post
hopefully an easy question davehodges Access 1 November 7th, 2007 06:36 AM
XML structure for easy XSLT coldstar XSLT 2 September 10th, 2006 04:09 PM
XSLT Newbie needs help... Should be easy fix! C4 XSLT 1 November 21st, 2005 04:11 AM
Easy Question yikomaka Visual C++ 0 June 13th, 2005 08:50 PM
Easy Question - I think gmoney060 Classic ASP Basics 3 November 2nd, 2004 06:54 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.