Affiliate Marketing
Forum Search

Reply
 
LinkBack Thread Tools Display Modes

  #1 (permalink)  
Old 26-09-06
accelerator's Avatar
Online shopping rocks!
 
Join Date: Nov 2004
Location: England
Posts: 1,314
Thanks: 8
Thanked 29 Times in 26 Posts
accelerator is an unknown quantity at this point
  XSL Formatting Price of Awin Feeds

Hi

In the Price fields of the Awin feeds I've noticed that some merchants include a currency code (i.e. GBP123.45) whereas others don't and it's just 123.45.

I want to transfer this data into a MySql database without the currency code in front. As I have to apply an XSL transform to the data first, can anybody tell me the way to remove the ccy code with XSL?

Thanks

Accelerator
__________________
WebRef.eu - Web Development Resources for the Online Entrepreneur
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 26-09-06
Registered User
 
Join Date: Jun 2006
Posts: 177
Thanks: 0
Thanked 1 Time in 1 Post
jonsp is an unknown quantity at this point
Is it always going to be GBP? If so strip out those 3 letters
<xsl:value-of select="translate(FieldName, 'GBP', '')"/>

If you need to take other actions depending on GBP UDS etc post back and I'll give an alternative.

Jon
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 26-09-06
accelerator's Avatar
Online shopping rocks!
 
Join Date: Nov 2004
Location: England
Posts: 1,314
Thanks: 8
Thanked 29 Times in 26 Posts
accelerator is an unknown quantity at this point
Hi Jon

Thanks for your reply. It is only sometimes that the GBP appears in front. What I think I need is a conditional XSL processing statement that if the GBP is there, it gets stripped off, otherwise the field can just be processed "as is".

I am looking at the:

<xsl:choose>
<xsl:when test="">
<xsltherwise>

functionality, but I don't know how to format the test statement to get this done.

Many thanks for your input.

Rgds

Accelerator
__________________
WebRef.eu - Web Development Resources for the Online Entrepreneur
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 26-09-06
Registered User
 
Join Date: Jun 2006
Posts: 177
Thanks: 0
Thanked 1 Time in 1 Post
jonsp is an unknown quantity at this point
OK in that case use what I posted up - translate works the same as replace in most languages it will just strip out a string, in this case 'GBP' if it exists and if not do nothing. The only reason I made it sound more complicated is I thought you might need to do something else if a different currency code appeared.

Jon
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
  #5 (permalink)  
Old 01-10-06
accelerator's Avatar
Online shopping rocks!
 
Join Date: Nov 2004
Location: England
Posts: 1,314
Thanks: 8
Thanked 29 Times in 26 Posts
accelerator is an unknown quantity at this point
I've tried this in my xsl file, but it's not working:

<Price><xsl:apply-templates select="translate(Price, 'GBP', ")"/></Price>

Any ideas where I'm going wrong anyone?

Thanks

Accelerator
__________________
WebRef.eu - Web Development Resources for the Online Entrepreneur
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 01-10-06
accelerator's Avatar
Online shopping rocks!
 
Join Date: Nov 2004
Location: England
Posts: 1,314
Thanks: 8
Thanked 29 Times in 26 Posts
accelerator is an unknown quantity at this point
Whoops, sorry guys, found my error, I needed xsl:value-of rather than xsl:apply-templates:

<Price><xsl:value-of select="translate(Price, 'GBP', '')"/></Price>

Thanks for your help jonsp.

Cheers

Accelerator
__________________
WebRef.eu - Web Development Resources for the Online Entrepreneur
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
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 On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
The Awin Index Dr Foster Affiliate Window 22 06-02-07 12:49 PM
Awin XML Feeds - Field Structure Information accelerator Widgets, Coding, AJAX, PHP - Technology & Affiliate Marketing 0 28-12-05 07:26 PM
The Good Feed Guide (For Merchants) clint45 Widgets, Coding, AJAX, PHP - Technology & Affiliate Marketing 13 17-11-05 09:30 PM
1/2 Price Line Rental Madness James TradeDoubler 1 22-10-04 05:12 PM
Transforming TD XML feeds with a stylesheet in PHP Andy TradeDoubler 0 12-08-04 03:32 PM


Affiliate Marketing RSS Feeds - Contact Us - Affiliate Marketing - Archive - Privacy Statement - Top

Content Relevant URLs by vBSEO 3.2.0 RC7