basement_addict
Posts: 78 Joined: Mon Nov 19, 2001 5:20 pm
Post
by basement_addict » Wed Feb 20, 2002 7:02 pm
It would be cool if there was a flag to <strfmt> a string into valid xml text
<$var="I've worked for at&t for < 1 year">
<strfmt %xml $var>
<xml>
<node>$ret</node>
</xml>
-------
result
<xml>
<node>I've worked for at&t for < 1 year</node>
</xml>
John
Site Admin
Posts: 2622 Joined: Mon Apr 24, 2000 3:18 pm
Location: Cleveland, OH
Contact:
Post
by John » Wed Feb 20, 2002 8:40 pm
You could use %H, which does HTML formatting. If you are in HTML mode anyway you could just display $var, and it will be escaped automatically for you.
John Turnbull
Thunderstone Software
basement_addict
Posts: 78 Joined: Mon Nov 19, 2001 5:20 pm
Post
by basement_addict » Thu Feb 21, 2002 11:54 am
what about characters like é in résumé.
it will return invalid character and not be well formed xml.
Kai
Site Admin
Posts: 1272 Joined: Tue Apr 25, 2000 1:27 pm
Post
by Kai » Thu Feb 21, 2002 1:43 pm
<strfmt "%H"> won't change 8-bit characters. You'd have to use a <sandr> to replace them with sequences like `’'.