|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: HTML forms with XSLT slideshow question
> On slide 19 you show an example of "generated JavaScript for SQL
Insert..."
> This interested me. I do not know a way to bind JavaScript to a data
source
> (database). I know how to do it for Java, and ASP...but not JavaScript.
> Your example does not show the binding. Am I misunderstanding the
example?
> If not could you share with me how to access a database from JavaScript.
In the example database is accessed from ASP:).
ASP can be used with either JavaScript, PERL or Python to achieve this
functionality.
Also CGI PERL or Python scripts can be used.
Here is what happens:
XSLT transformation generates JavaScript code in run-time
and ASP (JavaScript) executes it dynamically on the server via
javascript:eval() method.
XML+XSLT=run-time server-side script => client (D)HTML
So XSLT is used to generate server-side JavaScript with database API from
HTML template.
Now if you have 10 similar projects with 6 screens in each
(entry+search+search results+insert+delete+edit+...)
You have to maintain 10(XML)+6(XSL) =16 instead of 10*6=60 (ASP) scripts.
Where 10 XML scripts are straightforward and you can let even users edit
them given you are validating it against DTD.
Plus all other benefits.
In future JavaScript/XSLT combination might be replaced
when "mechanism for defining implementations of extensions" will be
extended:)
or vendors will provide vendor-specific extension functions for binding to a
data source.
Until then JavaScript/XSLT combination works great for me.
It is easy to write and easy to read. They complement each other neatly.
In fact XJS sounds like a good name for it.
I did not show particular database API on the slides because the whole
point of the presentation is that the technique is API independent.
All the best,
Nikita Ogievetsky
http://www.cogx.com
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








