I'm not certain about the XML spec, but in HTML it very much does need to
be escaped, specifically inside <textarea>...</textarea> tags in IE 5.5 or
else it does not let the form be submitted. Call that browser broken if
you wish, but that's the way the real world functions. I cannot "just put
&gt; in the primary source," because I'm getting the source from a form
submission like the one below, storing it in an XML file, then restoring it
dynamically to a form like the one below for editing the value later. XSLT
doesn't contain a generic search-and-replace function to convert all >
signs to &gt; on the fly, and no, translate() will not work, though a a
complicated loop of substring(), substring-before() and substring-after()
might do it... Seems better to me to fix Sablotron to behave the way I
need it at least for HTML output. Hacking the form submission receiving
script to do this conversion might work also though that would be really
weird for any non-Sablotron uses. Go ahead and try it:
<HTML>
<BODY>
<FORM> <!-- by default this submits to itself and the url should become
test.html?test=this+is+a+%3CA+HREF%3D%22%2F%22%3Etest%3C%2FA%3E.
-->
<TEXTAREA NAME="test">this is a <A HREF="/">test</A>.</TEXTAREA>
<INPUT TYPE="submit">
</FORM>
</BODY>
</HTML>
On my IE 5.5 Win2k, nothing at all happens when you press
"submit"... Netscape seems to work ok. IE works fine if I entity escape
the ">" characters above.
Dave
At 02:36 PM 7/17/2001 +0200, Pavel Hlavnicka wrote:
>the '>' sign doesn't have to be escaped, so it is not escaped. If you
>really need > in xml output file, you need put &gt; in the primary
>source.
>
>Pavel
>
>David Burry wrote:
>
>>Hi, I'm relatively new to xslt and even newer to this list, so hope this
>>is the right place...
>>Is there a good reason why this xml:
>><?xml version="1.0" encoding="ISO-8859-1" ?>
>><tag>
>>this is a <A HREF="/">test</A>.
>></tag>
>>plus this xsl:
>><?xml version="1.0" encoding="ISO-8859-1" ?>
>><xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
>>version="1.0">
>><xsl:output method="xml" encoding="ISO-8859-1"/>
>><!-- nothing needed here, since default output is tag contents -->
>><!-- we could also put a template here that contains one of -->
>><!-- value-of select="." or value-of select="text()" -->
>><!-- and we'd get the exact same results -->
>></xsl:stylesheet>
>>produces this output:
>><?xml version="1.0" encoding="ISO-8859-1"?>
>>this is a <A HREF="/">test</A>.
>>instead of this output:
>><?xml version="1.0" encoding="ISO-8859-1"?>
>>this is a <A HREF="/">test</A>.
>>?????
>>This kind of behavior is really messing up my HTML, making forms not
>>function (i.e. not submit) in IE because of technically badly formatted
>>default values, etc...
>>Dave
>
>
>
>--
>Pavel Hlavnicka
>Ginger Alliance
>www.gingerall.com