Go Back   CodingForums.com > :: Client side development > XML

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 02-02-2003, 03:48 PM   PM User | #1
brothercake
Senior Coder


 
Join Date: Jun 2002
Location: near Oswestry
Posts: 4,508
Thanks: 0
Thanked 0 Times in 0 Posts
brothercake is an unknown quantity at this point
can XSL escape?

I'm making this up, but what I want amounts to:

<xsl:escape-output><xsl:value-of select="node_data"/></xsl:escape-output>


Or maybe there's an XPath way. Any ideas?
brothercake is offline   Reply With Quote
Old 02-04-2003, 03:08 PM   PM User | #2
Alex Vincent
Moderator


 
Join Date: May 2002
Location: Hayward, CA
Posts: 1,427
Thanks: 1
Thanked 19 Times in 17 Posts
Alex Vincent is on a distinguished road
I'm not sure I follow. Isn't that what CDATA sections are for?
__________________
"The first step to confirming there is a bug in someone else's work is confirming there are no bugs in your own."
June 30, 2001
author, Verbosio prototype XML Editor
author, JavaScript Developer's Dictionary
https://alexvincent.us/blog
Alex Vincent is offline   Reply With Quote
Old 02-04-2003, 03:19 PM   PM User | #3
brothercake
Senior Coder


 
Join Date: Jun 2002
Location: near Oswestry
Posts: 4,508
Thanks: 0
Thanked 0 Times in 0 Posts
brothercake is an unknown quantity at this point
Well I'm generating js variables. eg:

<greeting>hello</greeting>

becomes

var greeting = "hello";

But if the XML has

<greeting>"Hello", he said, "it's nice to see you"</greeting>

How do I turn that into JS without getting errors?
brothercake is offline   Reply With Quote
Old 02-05-2003, 01:57 AM   PM User | #4
Alex Vincent
Moderator


 
Join Date: May 2002
Location: Hayward, CA
Posts: 1,427
Thanks: 1
Thanked 19 Times in 17 Posts
Alex Vincent is on a distinguished road
Hm. Maybe by using &amp;quot; or &amp;apos; . I think these are valid in XML.
__________________
"The first step to confirming there is a bug in someone else's work is confirming there are no bugs in your own."
June 30, 2001
author, Verbosio prototype XML Editor
author, JavaScript Developer's Dictionary
https://alexvincent.us/blog
Alex Vincent is offline   Reply With Quote
Old 02-05-2003, 02:58 AM   PM User | #5
jkd
Senior Coder

 
jkd's Avatar
 
Join Date: May 2002
Location: metro DC
Posts: 3,163
Thanks: 1
Thanked 18 Times in 18 Posts
jkd will become famous soon enough
Quote:
Originally posted by Alex Vincent
Hm. Maybe by using &amp;quot; or &amp;apos; . I think these are valid in XML.
yup
__________________
jasonkarldavis.com
jkd is offline   Reply With Quote
Old 02-05-2003, 04:41 AM   PM User | #6
BrainJar
Regular Coder

 
Join Date: Jun 2002
Posts: 185
Thanks: 0
Thanked 0 Times in 0 Posts
BrainJar is an unknown quantity at this point
You could also the \x escape sequence with hex codes. This is valid in JS:

var greeting = "\x22Hello\x22, he said, \x22it\x27s nice to see you\x22";
BrainJar is offline   Reply With Quote
Old 02-05-2003, 09:52 AM   PM User | #7
brothercake
Senior Coder


 
Join Date: Jun 2002
Location: near Oswestry
Posts: 4,508
Thanks: 0
Thanked 0 Times in 0 Posts
brothercake is an unknown quantity at this point
I tried those entitites - but they get parsed back into " and ' in the transformation ... end result is the same.

But hex codes I haven't tried. Thanks - I'll try that now
brothercake is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

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 On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 08:06 PM.


Advertisement
Log in to turn off these ads.