Subject: Re: [xsl] xsl:apply-templates in javascript From: Wendell Piez <wapiez@xxxxxxxxxxxxxxxx> Date: Wed, 25 May 2005 12:22:24 -0400 |
Cheers, Wendell
Brandon,
Is it really necessary to load part of your document dynamically? (I'd consider the simpler solution of simply hiding the content and exposing it dynamically, if I could.)
If so, you might ask that question -- how do I load part of a document dynamically -- in whatever scripting forum is appropriate. (I don't know what kinds of constraints over your scripting you face: e.g. must this be multi-platform. But those aren't XSLT questions.)
In general, your question is difficult because two different paradigms of document processing are colliding. In general, the Javascript method of "tag-writing" output back to the browser is inimical to (though as you have supposed, not impossible in) XSLT, where we prefer to serialize whole document trees, not just fragments at a time (thus it's an architectural question). Fortunately, these days one has the DOM, and the browsers support methods for working with sets of nodes (elements and attributes) rather than writing tags. I'd try writing my Javascript to use such methods, rather than doing tag writing.
But none of that is really pertinent to XSLT. To answer the question as given: you can "tag write" HTML if you want to (just as you can "tag write" a representation of the XML source), using disable-output-escaping. It would be a terrible shame, but it could be done.
I have my doubts that the resulting Javascript would be either as robust or as portable as Javascript DOM methods, however.
====================================================================== Wendell Piez mailto:wapiez@xxxxxxxxxxxxxxxx Mulberry Technologies, Inc. http://www.mulberrytech.com 17 West Jefferson Street Direct Phone: 301/315-9635 Suite 207 Phone: 301/315-9631 Rockville, MD 20850 Fax: 301/315-8285 ---------------------------------------------------------------------- Mulberry Technologies: A Consultancy Specializing in SGML and XML ======================================================================
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] xsl:apply-templates in ja, Wendell Piez | Thread | Re: [xsl] xsl:apply-templates in ja, Brandon Borkholder |
Re: [xsl] output to two files with , Rahil | Date | [xsl] Flat to hierarchical with for, JBryant |
Month |