This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes XML and Related Technologies and the fly likes XSLT: escaping Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "XSLT: escaping " in output text" Watch "XSLT: escaping " in output text" New topic
Author

XSLT: escaping " in output text

Neil Laurance
Ranch Hand

Joined: Jul 18, 2002
Posts: 183
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

Joined: Jul 18, 2002
Posts: 183
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

Joined: Jul 18, 2002
Posts: 183
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 ]
 
 
subject: XSLT: escaping " in output text
 
Similar Threads
Retrieve objects from XSL transform
A Beginner's Question
Using XSL to display XML
Remove unwanted space before and after the table using javascript
Mulitple fo:page-sequence