• 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
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

XSLT: escaping " in output text

 
Ranch Hand
Posts: 183
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I was wondering if anyone could help me out on this one. I have a small XML file like:

I am creating a very simple XSLT to transform this to CSV output. I have the following XSLT:

Which produces:

Which is almost there. However, I want to escape any (") characters. I have tried something like:

But this complains with:

I just can't seem to escape the (") characters correctly Anyone solved this one?

Thanks, Neil
 
Neil Laurance
Ranch Hand
Posts: 183
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Actually, thinking about it, I don't think I can use translate. This function replaces one character with another. Whilst I wan't to replace one character with two others. I think I may need to create a recursive template?
 
Neil Laurance
Ranch Hand
Posts: 183
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Managed to suss it, borrowing from XSLT Programmer's Reference:

Cheers, Neil

[ December 17, 2004: Message edited by: Neil Laurance ]

Edit Comment: Disabled smiles. - m
[ December 17, 2004: Message edited by: Madhav Lakkapragada ]
 
I'm not sure if I approve of this interruption. But this tiny ad checks out:
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
reply
    Bookmark Topic Watch Topic
  • New Topic