Subject: Re: [xsl] XSL template "namespace" problem From: Ian Bonnycastle <ibonny@xxxxxxxxxxxx> Date: Wed, 29 Mar 2006 20:29:14 -0500 (EST) |
Yes, it does. (And it's what I thought I said: it does the same thing.) Using xsl:text does, however, make it more obvious what is happening with those fragments of Javascript code: they are being copied to the result document, and nothing more. Most especially, they aren't being interpreted or executed by anything (that is, until the web browser starts doing things with what it gets out the other end of the transformation).
Actually as we pointed out your second example (the one I modified with xsl:text) was well-formed XSLT all along. It was the goofy
<A HREF="javascript:Toggle('<xsl:value-of select="fname" />')"><xsl:value-of select="name" /></A>
which you posted this morning that's not well-formed.
As for your result, the term "well-formed" doesn't really apply to it one way or another, since the term doesn't apply to generic HTML. (If your HTML happens to follow all the XML syntax rules, it's well-formed by definition. If it doesn't, it's not. That question is out of scope for your problem.)
The presence or absence of Javascript in either the XSLT or the HTML result has *no bearing* on whether the file is well-formed or not. To an XML parser the Javascript is just text, like any other. The rules of well-formedness dictate how XML tags are constructed and how they are applied to text data; apart from restricting the data content not to have unescaped "<" and "&" characters (since those say "markup starts here!"), these rules do not limit what you put in that text, whether it be Javascript or anything else.
This is a good thing to do because it controls the various layers more discretely; but if you're doing it without understanding why, you're only solving your problem until the next time you have it. Understanding what "well-formedness" consists of (and doesn't) in the context of XML is pretty basic.
Right, that's the down side. As I said, you've opted to start your education with a blue square slope -- if not a black diamond -- when you could have started with a green circle. (Apologies to you and any readers who don't ski downhill. Think "skiing down steep slopes with rocks" and you'll get the idea.)
Yup. Also less bandwidth is consumed since the smaller pieces can be passed around and cached independently.
CSS stylesheets are applied to HTML documents by the rendering engine, which does its work independently of any XML transformation. (More usually, the browser is simply delivered HTML and perhaps CSS, and the rendering engine doesn't have to wait for a transformation.
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] XSL template "namespace" , Wendell Piez | Thread | Re: [xsl] XSL template "namespace" , Wendell Piez |
[xsl] Namespaces., Kamal Bhatt | Date | AW: [xsl] XSL 1.1 -> Asking for an , news |
Month |