Client-side Dynamic XML Transforms?

wxdqz

New Member
I've been researching XML for about a week now, and have had extreme difficulty finding info on "dynamic" XHTML, XML, XSL, thus the XML equivalent of DHTML. I understand the three ways of implementing XSLT on the Internet (I am aware that it is designed for several ouputs, but lets keep this simple): browser, client and server.

Unfortunately only the most recent browsers implement XSL and even then their parsers seem to have difficulties or do not adhere to the W3 recommendations correctly. This alone makes one question if XML implementation is viable considering cross-browser compatibility issues. I'm not even sure if all browsers can recognize XHTML Strict. Thus I've come to the conclusion that XML transformations in the browser is not a solution at this time.

I do believe that for the time being that XSLT server-side transformations are the best solution. However, there leaves the problem of soft refresh dynamically created content, which is what XSLT was designed for. To be able to display XML files dynamically within the client including data reorganization and styles.

Which leaves JavaScript, but as Charles would tell you, there comes the problem of accessibility laws and enabled browsers. Not to mention all the problems regarding cross-browser compatible code.

So to satisfy Charles, lets say we've designed a site using a static menu system that doesn't use JavaScript and fills in all the other requirements and suggestions for disabilities. Now we built a second site which is dynamic, how would I dynamically create XHTML using XML, with XSL styles and transforms on the client? The only server-side script (PHP, ASP, I don't care, it's moot to this discussion) I want to use is onClick or OnLoad.

For example I want to build a dynamically created three tier expandable vertical menu like CssCreator's MultiMenu (<!-- m --><a class="postlink" href="http://www.csscreator.com/menu/multimenu.php">http://www.csscreator.com/menu/multimenu.php</a><!-- m -->) using one XML file describing the menu and one XSL file that will display parent and child node(s) according to the parents location in the main menu. I haven't studied long enough to explain this the way it's in my head, and unfortunately I don't have any code to show either. Just use the above link for a visual reference.

Remember, I said I only want one XSL file, as that should all be that's needed to manipulate the one XML menu descriptor file. Atleast that's my understanding of XSLT. Therefore, I want this XSL file to be rewrote with each mouseEvent over the main menu (parent.) I can do this easily with server-side if the menu uses anchors or images including an href when it's clicked, as a mouse click will cause an hard refresh. I should also mention that layout designs (div/tables) and display/visibility should be handled using XSL as well and not CSS (W3School Article (<!-- m --><a class="postlink" href="http://www.w3schools.com/xml/xml_display.asp">http://www.w3schools.com/xml/xml_display.asp</a><!-- m -->).)

Originally posted by Robert Wellock
XHTML and CSS-P are a stable diet for any serious Web Author. PHP is a time saver and adds dynamic capacity to a website and helps interact with a Server to generate XHTML from templates or connect to a Database Driven site much like this forum.

But what if I want this same functionality with an Event Handler (<!-- m --><a class="postlink" href="http://www.w3schools.com/dhtml/dhtml_events.asp">http://www.w3schools.com/dhtml/dhtml_events.asp</a><!-- m -->)?

Here lies the problem, unless someone can tell me otherwise, is that client-side script cannot write a file. I have read threads discussing dynamically generated JavaScript using XSL, but can we dynamically generate XSL with JavaScript? Bare in mind that if adding JavaScript to CSS files is not recommended ( QuirksMode Article (<!-- m --><a class="postlink" href="http://www.quirksmode.org/css/javascript.html">http://www.quirksmode.org/css/javascript.html</a><!-- m -->)) then adding JS to XSL shouldn't be recommended either. Of course, we could always write several XSL pages for each particular event, but with the potential of a three tiered menu, that may require a database to itself.

So how do we create dynamic content on the client, as oposed to the server, with the XML family?
 
Back
Top