• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

dollar sign question

 
Ranch Hand
Posts: 112
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,
I got a problem here and didn't figure out how to do it. any ideas?
I have a news servlet that accept user get the news contents(XML) back by sending a http request. I apply the stylesheet to generate wml file on the fly and output through simulator and wap phone. The problem is when the news contain the dollar sign($), the transform engine will fail to generate the wml file. any ideas how to avoid this problem?? Thanks.
 
Zoe Peng
Ranch Hand
Posts: 112
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, there
when xml file apply the stylesheet, can I filter the Content?
What I want to do is when Content contains $, I'll output the $$.
here is the stylesheet:
<xsl:for-each select="News/Stories/Story">
<xsl:value-of select="Content"/> <br/>
</xsl:for-each>
any ideas? Thanks
Regards, Zoe
 
Leverager of our synergies
Posts: 10065
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you could substitute $ with some other symbol, it would be simple
<xsl:value-of select="translate (Content, '$', 'someOtherSymbol' )"/>
If not, check this XSL:
http://skew.org/xml/stylesheets/replace/replace.xsl
 
Zoe Peng
Ranch Hand
Posts: 112
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks.
I'll give them a try.
--Zoe
 
Zoe Peng
Ranch Hand
Posts: 112
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,
Got problem here:
fail in these situations:
<xsl:value-of select="translate (Content, '$', '$$' )"/> --> result still $, fail in wap phone
<xsl:value-of select="translate (Content, '$', 'ABC' )"/> --> result is A
Does any body know the &thing for dallor sign?
any ideas?
Thanks
 
Zoe Peng
Ranch Hand
Posts: 112
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
does anybody know what's the &thing for dollar sign?
& = &
&thing; = $
Thanks
 
Mapraputa Is
Leverager of our synergies
Posts: 10065
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
translate() function will output as many symbols as it got as input.
$ can be representded as &#36; or &#x24; if it will help...
 
Zoe Peng
Ranch Hand
Posts: 112
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello Mapraputa,
Thanks.
It ends up that I concat one more $ after I substring the xml content. I think that's I need for xml to wml file after I apply stylesheet.
cuz & and & comes out the same result.
translate() is 1 to 1. It won't slove my problem.
Here is the useful website for unicode character: (as a reference)
http://www.zvon.org/other/charSearch/PHP/search.php
Thanks again.
 
The harder I work, the luckier I get. -Sam Goldwyn So tiny. - this ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic