[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

Re: [xsl] Any samples of client-side XSLT to generate webpages?


Subject: Re: [xsl] Any samples of client-side XSLT to generate webpages?
From: Marcus Andersson <marcus@xxxxxxxxxx>
Date: Tue, 27 Jul 2004 10:04:40 +0200

Daniel Joshua wrote:


document.getElementById("appendChild") .appendChild(document.importNode(resultDoc.documentElement, true));

it lookes like you are add a whole document into a the "appendChild"
element, is that legal or am I mistaken?

It's perfectly legal the way it's done (from a node perspective). But it doesn't enforce that the usage is correct (ie you can create a complete html document with html-head-body etc with your transform and it would be incorrect (from a DTD point of view) if you added that to a div in your document, but if you produce a document that has for example a div as it's root element then it's perfectly legal). You mostly use Sarissa (and approaches similar to Sarissa) to produce HTML fragments and not complete HTML documents (unless you want to overwrite a complete document with the result, this is done for example if you opens a window or iframe on the client and want to populate it from scratch). At least I do.

/Marcus


Current Thread