This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

XSLT: escaping " in output text

 
Neil Laurance
Ranch Hand
Posts: 183
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • 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 ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic