Subject: Re: Generating XML(HTML) from script in IE5b2... From: Guy_Murphy@xxxxxxxxxx Date: Tue, 5 Jan 1999 16:37:39 +0000 |
Hi Joe. Thanks for the reply, if not the regrinding of an old axe :) I did as you suggested and ran the script in a browser, I've used similar scripts countless times in web development, but just to be sure tried the follwoing in IE. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html> <head> <title>Untitled</title> <script type="text/JScript"> function displayVert (text) { var result = ''; for (var i = 0; i < text.length; i++) { result += '<div>'+text.substr(i, 1)+'</div>'; } return result; } </script> </head> <body> <script type="text/JScript"> document.write(displayVert('TEST')); </script> </body> </html> Why wouldn't you expect this to work in a HTML file? Secondly, rather than expecting XSL to re-parse the result, why would I expect it to parse the result at all? I'm not being sarcastic, being new to all this, I might well be missing something. The script.... <xsl:script> <![CDATA[ function displayVert (node) { var result = ''; var text = node.text; for (var i = 0; i < text.length; i++) { result += '<div>'+text.substr(i, 1)+'</div>'; } return result; } ]]> </xsl:script> ... is marked as CDATA, so the <> for the DIVs shouldn't get changed to < > there, and where it's getting called, I was expecting it to get written out to the output document, not get re-parsed. In short I don't think I'm getting what I asked for... what exactly are you assuming I asked for? :) On the issue of generating nodes to be returned, and then output... hmmm not sure if it can be done with scripting in IE5 XSL, guess I'll have to tinker and see. I seem to remember a thread discussing outputting a string rather than a node tree, I guess I'll have to take a look at that too as I'm making erroneous assumptions about what XSL can spit out, I'm not getting my head around the fact that it's a node tree it's producing (which I'm not convinced is a god idea). <teasing>I just love discussing issues of an MS product with an IBM researcher</teasing> Cheers Guy. xsl-list@xxxxxxxxxxxxxxxx on 01/05/99 06:10:07 PM To: xsl-list@xxxxxxxxxxxxxxxx cc: (bcc: Guy Murphy/UK/MAID) Subject: Generating XML(HTML) from script in IE5b2... Looks to me as if you're getting what you asked for. You probably want to generate your <div/> nodes as nodes rather than writing them as text content and expecting them to be re-parsed. But as far as I can tell, that's a matter of how your script is written, not how XSL is handling it. (To prove this to yourself, try running the same script in a hand-generated HTML file...) ______________________________________ Joe Kesselman / IBM Research Unless stated otherwise, all opinions are solely those of the author. XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Generating XML(HTML) from script in, keshlam | Thread | Re: Generating XML(HTML) from scrip, Oren Ben-Kiki |
Generating XML(HTML) from script in, keshlam | Date | Re: Generating XML(HTML) from scrip, Oren Ben-Kiki |
Month |