Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > XML > XSLT
Password Reminder
Register
| FAQ | Members List | Calendar | 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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
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


Reply With Quote
  #2 (permalink)  
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


Reply With Quote
  #3 (permalink)  
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


Reply With Quote
  #4 (permalink)  
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>

Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 09:53 PM.


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