Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


RE: [xml-dev] help request: incremental XSLT(-ish?) in javascript

From: Thomas Lord <lord@---.--->
To: w3c@----.----
Date: 10/8/2009 9:07:00 PM
On Thu, 2009-10-08 at 13:53 -0700, w3c@d... wrote:
> Thomas,

> Once the content is loaded into the DOM in the browser content it is
> fully accessible by the Javascript.


Yes, of course.   I want to have javascript programs
update the display with changes to the HTML DOM of
the page.

However, I don't want the javascript programs to touch
that DOM directly but rather through a library.

I want a second DOM around - an XML object.   The HTML
DOM for the page is related to the XML object either
literally by an XSLT script or by something similar.
When I change the *XML DOM* - I want the HTML transformed
DOM to be incrementally updated.

For example, suppose my Javascript program has requested
some resource and got back XML like:

  <books>
    <title>Gnu Emacs Manual</title>
    <title>Mathematial Logic and Programming Languages</title>
    <title>Smalltalk 80: The Language and its Implementation</title>
  </books>

and the XSLT program transforms that into any number of possible
presentations, such as:

  <ul>
    <li>Gnu Emacs Manual</li>
    ...etc...
  </ul>

I am looking for a way so that if the Javascript program modifies
the XML - say by adding an additional book - that the HTML DOM
is automagically updated, say by inserting a new "li" element
in the appropriate place.




> But it sounds like you want something that reacts to incoming events
> too - again Javascript can send and receive SOAP messages / or REST /
> for example - and update accordingly.

Yes, I know all of that.  I'm very narrowly interested
in a "missing piece" which is this incrementally updatable
XML->HTTP transform.



> This is all done already - initial xslt runs loads xml, html and
> javascript into browser - its called AJAX!


It's not.  You've misunderstood. I'm dumb as a post, I'm sure,
but I'm not *that* stupid :-)

-t



> 
> Enjoy, DW
> 
> 
>         -------- Original Message --------
>         Subject: [xml-dev] help request: incremental XSLT(-ish?) in
>         javascript
>         From: Thomas Lord <lord@e...>
>         Date: Thu, October 08, 2009 2:33 pm
>         To: xml-dev@l...
>         
>         I am looking for a piece of software that I've
>         come to suspect doesn't exist - but I thought 
>         I'd ask here as one way to double check.
>         
>         We are used to the idea of browsers receiving
>         XML, retrieving a linked XSLT program, and applying
>         that program to produce an HTML DOM for display.
>         
>         I am wishing for taking that one step further.
>         I would like a client-side XSLT implementation
>         that does that transform, but that also keeps around
>         the XML. I would like Javascript programs to be 
>         able to modify the XML DOM objects and to have those
>         changes *incrementally* reflected in updates to 
>         the HTML DOM.
>         
>         I know that for arbitrary XSLT, such incremental 
>         transforms can not always be fast. For example,
>         it is trivial to write an XSLT program such that a
>         single character change to a text datum in the XML
>         causes the HTML to have to be completely regenerated
>         from scratch.
>         
>         I do hope for a solution where it is easy to write
>         a wide range of XSLT programs that *can* be updated
>         fast, incrementally. That is to say: I want good
>         performance in the easy cases and don't care so much
>         how the hard cases are handled.
>         
>         I would prefer XSLT but I suppose it is not essential.
>         Something similar but non-standard is OK, if that's all
>         there is.
>         
>         Why do I want this? Well:
>         
>         I would like to build a system that roughly follows
>         a "model-view-controller" pattern. The XML will 
>         serve as model. The HTML and some event handling hooks
>         will serve as view. The main logic of an application
>         are the commands (in Javascript) that the view can 
>         trigger and which operate by having side effects on
>         the XML (the model) - that "command system" of the 
>         application is the controller.
>         
>         Is there such a piece of software around (that is
>         licensed as free software)? My impression is that
>         there is not - which I find somewhat surprising.
>         
>         Finally, one person I mentioned this to admonished me
>         that I was proposing to use XSLT and Javascript in ways
>         they were never intended for and were ill suited for.
>         I could not get a clear sense from him of *why* he 
>         thought so, but that is what he said. Is he right?
>         
>         Thanks,
>         -t
>         
>         
>         
>         _______________________________________________________________________
>         
>         XML-DEV is a publicly archived, unmoderated list hosted by
>         OASIS
>         to support XML implementation and development. To minimize
>         spam in the archives, you must subscribe before posting.
>         
>         [Un]Subscribe/change address:
>         http://www.oasis-open.org/mlmanage/
>         Or unsubscribe: xml-dev-unsubscribe@l...
>         subscribe: xml-dev-subscribe@l...
>         List archive: http://lists.xml.org/archives/xml-dev/
>         List Guidelines:
>         http://www.oasis-open.org/maillists/guidelines.php
>         
>         
> _______________________________________________________________________ XML-DEV is a publicly archived, unmoderated list hosted by OASIS to support XML implementation and development. To minimize spam in the archives, you must subscribe before posting. [Un]Subscribe/change address: http://www.oasis-open.org/mlmanage/ Or unsubscribe: xml-dev-unsubscribe@l... subscribe: xml-dev-subscribe@l... List archive: http://lists.xml.org/archives/xml-dev/ List Guidelines: http://www.oasis-open.org/maillists/guidelines.php


_______________________________________________________________________

XML-DEV is a publicly archived, unmoderated list hosted by OASIS
to support XML implementation and development. To minimize
spam in the archives, you must subscribe before posting.

[Un]Subscribe/change address: http://www.oasis-open.org/mlmanage/
Or unsubscribe: xml-dev-unsubscribe@l...
subscribe: xml-dev-subscribe@l...
List archive: http://lists.xml.org/archives/xml-dev/
List Guidelines: http://www.oasis-open.org/maillists/guidelines.php



transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent