473,327 Members | 2,016 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,327 software developers and data experts.

Can I use an xslt stylesheet to update a web page?

I have a data intensive web app I am developing. The core of the app
will do a db query and build a page. I plan on getting the data as xml
and feeding that and a xslt stylesheet to the browser. Here is my
question: the user can the request more data. I would like to somehow
use the same (or a version thereof) stylesheet to transform this new
data. But this is added to the existing page, not replacing it. Is
there a simple way to do this?

TIA.

--
Matt Silberstein

Do something today about the Darfur Genocide

http://www.beawitness.org
http://www.darfurgenocide.org
http://www.savedarfur.org

"Darfur: A Genocide We can Stop"
Apr 25 '06 #1
11 1282

Matt Silberstein wrote:
But this is added to the existing page, not replacing it.


What does "added to the existing page" mean?

This is the web. HTTP works so that you get a new page (which might be
bigger) and although it _looks_ like "the old page with things added to
it", it's actually a whole new page made of entirely new bits and
bytes. So from the traditionalist HTTP view, your request is
impossible because HTTP just doesn't work like that.

For good efficient design, you should look at caching the stylesheet on
the server though - that's certainly worth doing.
However your request is a reasonable one and these days it's
increasingly possible. Look at using AJAX for a way that really is
"adding to the existing page". This depends on client-side scripting
though.

Apr 25 '06 #2
Andy Dingley <di*****@codesmiths.com> wrote:
However your request is a reasonable one and these days it's
increasingly possible. Look at using AJAX for a way that really is
"adding to the existing page". This depends on client-side scripting
though.


An alternative could be content assembly somewhere between the
origin and the browser. The idea being that a proxy, or a filter
within the server, caches the original contents and adds new
contents as necessary. This can be used to avoid repeating
expensive processing on the server, while also avoiding browser-
dependent scripting.

http://www.eu.apachecon.com/konferen...ml#session-th7

--
Nick Kew
Apr 25 '06 #3
On 25 Apr 2006 02:43:04 -0700, in comp.text.xml , "Andy Dingley
<di*****@codesmiths.com>" <di*****@codesmiths.com> in
<11**********************@u72g2000cwu.googlegroups .com> wrote:

Matt Silberstein wrote:
But this is added to the existing page, not replacing it.


What does "added to the existing page" mean?

This is the web. HTTP works so that you get a new page (which might be
bigger) and although it _looks_ like "the old page with things added to
it", it's actually a whole new page made of entirely new bits and
bytes. So from the traditionalist HTTP view, your request is
impossible because HTTP just doesn't work like that.

For good efficient design, you should look at caching the stylesheet on
the server though - that's certainly worth doing.
However your request is a reasonable one and these days it's
increasingly possible. Look at using AJAX for a way that really is
"adding to the existing page". This depends on client-side scripting
though.


I was not clear, sorry. Yes, it is going to be an AJAX app, there is
lots of JavaScript already. What I wanted was some JavaScript way to
transform the incoming xml. That way I only need to maintain one codes
base that turns the data to a displayable form. I can use a xslt
stylesheet for the initial, but would have to do the update (getting a
new record, for example) through JavaScript.
--
Matt Silberstein

Do something today about the Darfur Genocide

http://www.beawitness.org
http://www.darfurgenocide.org
http://www.savedarfur.org

"Darfur: A Genocide We can Stop"
Apr 25 '06 #4
Matt Silberstein wrote:
[...] Yes, it is going to be an AJAX app, there is lots of JavaScript
already. What I wanted was some JavaScript way to transform the incoming
xml. That way I only need to maintain one codes base that turns the data
to a displayable form. I can use a xslt stylesheet for the initial, but
would have to do the update (getting a new record, for example) through
JavaScript.


<URL:http://xulplanet.com/references/objref/XSLTProcessor.html>
<URL:http://developer.mozilla.org/en/docs/XSLT>
HTH

PointedEars, F'up2 cljs
Apr 25 '06 #5

Nick Kew wrote:
An alternative could be content assembly somewhere between the
origin and the browser. The idea being that a proxy, or a filter
within the server, caches the original contents and adds new
contents as necessary.


I'd be somewhat unhappy about the concepts of "filter" and "adding new
content" being so closely coupled. I'm happy about filters that
transcode content or manipulate presentation, but something that adds
original content of the same order as the initial content ? That
sounds like a recipe for spaghetti data paths.

Apr 25 '06 #6
Andy Dingley <di*****@codesmiths.com> wrote:
Nick Kew wrote:

An alternative could be content assembly somewhere between the
origin and the browser. The idea being that a proxy, or a filter
within the server, caches the original contents and adds new
contents as necessary.

I'd be somewhat unhappy about the concepts of "filter" and "adding new
content" being so closely coupled. I'm happy about filters that
transcode content or manipulate presentation, but something that adds
original content of the same order as the initial content ? That
sounds like a recipe for spaghetti data paths.

It's what the OP asked for.

It's also widely practiced: for example, SSI, XSLT or ESI are
inherently filters, while JSP, PHP, or any templating system
are at least *conceptually* the same. Which both supports and
refutes your point: PHP is the biggest bodge-job, but is not
in fact implemented as a filter - for reasons that have never
been clear to me beyond "it breaks" (even more than it's
already broken).

Other content assembly happens at the browser - e.g. <img src="...">
Or at an aggregator. Or ... basically anywhere.

--
Nick Kew
Apr 25 '06 #7
Nick Kew wrote:
It's also widely practiced: for example, SSI, XSLT or ESI are
inherently filters, while JSP, PHP, or any templating system
are at least *conceptually* the same.


JSP should (and frequently is) no more than a presentational layer --
that's what tag libraries are for, and why half-decent Java work makes
such an effort to separate logic and presentation..

The biggest difference between JSP and ASP code is that ASP code sucks.
Not that ASP itself sucks, or that all ASP code sucks - but the general
working practice of a good JSP shop is encouraged to be good (it's
those tag libraries, amongst other things), whilst that of ASP is one
big tarball of mixed logic and presentation. Just go to an ASP
developer and ask about even something as ancient MVC - they'll just
stare at you in bafflement.

It's sometimes said that the only way to make a good ASP coder is to
teach them JSP first. And the only way to make a decent ASP coder is to
show them JSP as an example of what's possible and how it ought to be
structured.

PHP is, of course, simply beyond the pale.

Apr 25 '06 #8
On Tue, 25 Apr 2006 14:44:29 +0200, in comp.lang.javascript , Thomas
'PointedEars' Lahn <Po*********@web.de> in
<15****************@PointedEars.de> wrote:
Matt Silberstein wrote:
[...] Yes, it is going to be an AJAX app, there is lots of JavaScript
already. What I wanted was some JavaScript way to transform the incoming
xml. That way I only need to maintain one codes base that turns the data
to a displayable form. I can use a xslt stylesheet for the initial, but
would have to do the update (getting a new record, for example) through
JavaScript.


<URL:http://xulplanet.com/references/objref/XSLTProcessor.html>
<URL:http://developer.mozilla.org/en/docs/XSLT>
HTH


Thanks. TranformtoFragment is exactly what I want. Unfortunately it
looks like that only works for Mozilla/Firefox. So I have to figure
out something else for IE. I really don't want two pieces of code that
do the same thing. Maybe I will do the transform on the server for IE.
Not as clean but I can have just one stylesheet.

--
Matt Silberstein

Do something today about the Darfur Genocide

http://www.beawitness.org
http://www.darfurgenocide.org
http://www.savedarfur.org

"Darfur: A Genocide We can Stop"
Apr 25 '06 #9
Matt Silberstein wrote:
On Tue, 25 Apr 2006 14:44:29 +0200, in comp.lang.javascript , Thomas
'PointedEars' Lahn <Po*********@web.de> in
<15****************@PointedEars.de> wrote:
Please trim your attribution to the essentials.
Matt Silberstein wrote:
[Transform XML markup according to an XSL stylesheet]


<URL:http://xulplanet.com/references/objref/XSLTProcessor.html>
<URL:http://developer.mozilla.org/en/docs/XSLT>
[...]


Thanks. TranformtoFragment is exactly what I want. Unfortunately it
looks like that only works for Mozilla/Firefox. So I have to figure
out something else for IE. I really don't want two pieces of code that
do the same thing.


I am afraid if you code client-side, you will have to.
Maybe I will do the transform on the server for IE.
Not as clean but I can have just one stylesheet.


I am pretty sure MSXML provides a solution for this, both client-side and
server-side.
PointedEars
--
Germany is the birth place of psychiatry. Psychs feel threatened by
Scientology as they are crazy. Many psychs become psychs to heal their own
mental problems and to control others. -- "The only real Barbara Schwarz",
dsw.scientology, <16**************************@posting.google.com >
Apr 25 '06 #10


Matt Silberstein wrote:
TranformtoFragment is exactly what I want. Unfortunately it
looks like that only works for Mozilla/Firefox.
It also works with Opera 9 beta respectively will work with Opera 9 once
it has been released.
So I have to figure
out something else for IE. I really don't want two pieces of code that
do the same thing. Maybe I will do the transform on the server for IE.


IE 6 uses MSXML 3 for XML, XSLT and XPath. The API is different from the
Mozilla API and the implementation is separate from the HTML DOM IE
provides so you can't create a document fragment of an IE HTML document.
So usually you will create a string with a HTML snippet and insert that
into the HTML DOM tree using innerHTML or insertAdjacentHTML.
--

Martin Honnen
http://JavaScript.FAQTs.com/
Apr 25 '06 #11
JRS: In article <10******************@PointedEars.de>, dated Tue, 25
Apr 2006 19:17:55 remote, seen in news:comp.lang.javascript, Thomas
'Ludwig II' Lahn <Po*********@web.de> posted :
Matt Silberstein wrote:
On Tue, 25 Apr 2006 14:44:29 +0200, in comp.lang.javascript , Thomas
'PointedEars' Lahn <Po*********@web.de> in
<15****************@PointedEars.de> wrote:
Please trim your attribution to the essentials.


Matt, your attribution is substantially compliant with USEFOR thinking;
a full attribution is often helpful. Be aware that Thomas Lahn
evidently has ambitions to lead the Fourth Reich.

PointedEars
--
Germany is the birth place of psychiatry. Psychs feel threatened by
Scientology as they are crazy. Many psychs become psychs to heal their own
mental problems and to control others. -- "The only real Barbara Schwarz",
dsw.scientology, <16**************************@posting.google.com >


(1) Non-compliant with RFC1855.
(2) Given your personal condition, don't you consider it unwise to
introduce the subject of German psychiatry?

--
© John Stockton, Surrey, UK. yyww merlyn demon co uk Turnpike v4.00 MIME ©
Web <URL:http://www.uwasa.fi/~ts/http/tsfaq.html> -> Timo Salmi: Usenet Q&A.
Web <URL:http://www.merlyn.demon.co.uk/news-use.htm> : about usage of News.
No Encoding. Quotes before replies. Snip well. Write clearly. Don't Mail News.
Apr 26 '06 #12

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Pete | last post by:
I am just getting to grips with XML and I was wondering if you could help me with something that no-one seems able or willing to help with.. I have an XSLT file which should be transforming a...
1
by: Mohit | last post by:
Hi Friends I have to call 1 of the 2 child XSLT files from the Main XSLT file based on some criteria. I want one child XSLT file will be executed by version 1 of XSLT processor and the other by...
12
by: gipsy boy | last post by:
Hello, I have sort of a big problem. I would really appreciate any help you could give me. I made a web service in C++ that throws XML to the client (browser). But, the XSLT transormation...
2
by: FrankStallone | last post by:
I am just getting started in XML and I made my first xml, dtd and xslt file and XML spy said they were all valid and they worked. This was the xslt doc that worked. <?xml version="1.0"...
7
by: Harolds | last post by:
The code below worked in VS 2003 & dotnet framework 1.1 but now in VS 2005 the pmID is evaluated to "" instead of what the value is set to: .... xmlItems.Document = pmXML // Add the pmID...
7
by: Matt Silberstein | last post by:
I have a data intensive web app I am developing. The core of the app will do a db query and build a page. I plan on getting the data as xml and feeding that and a xslt stylesheet to the browser....
0
by: DAnne | last post by:
Hi, I'm very new to xslt and this is my first time posting to a Forum so please forgive me if I transgress any protocols. I have to do a tally report. This report is divided up into sections....
4
by: J | last post by:
I've spent most of the day on this, and I just can't seem to find a solution, please help me! :) I'm recieving XML that I can't modify that looks like: <?xml version="1.0"?> <Doc> <Page>...
3
by: super.raddish | last post by:
Greetings, I am relatively new to, what I would call, advanced XSLT/XPath and I am after some advice from those in the know. I am attempting to figure out a mechanism within XSLT to compare the...
4
by: th1421 | last post by:
Hi, I'm new to FireFox. I am currently trying to convert my website to be compatible with it. Doing so I’m trying to process some XML/XSLT pages (preferably without using JavaScript). When I...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.