473,748 Members | 5,429 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

update MULTIPLE elements of an HTML page using Ajax and XSL

Hi all,
I want to update MULTIPLE elements of an HTML page using Ajax. for
this reason i my response is an xml document. I want to use XSL at the
client side to update these elements. How can i achieve this?
I will be very greatefull for any help.
Have a look below
=============== =============== =============== ========
Response from Server using HttpRequest Object
=============== =============== =============== ========

<?xml version="1.0" encoding="UTF-8"?>
<responses>
<response id="1">
<divmy name is ivo sumelong in berlin and i will be coming to london
next week</div>
</response>
<response id="2">
<divgreat peopele strive for greater things as well realised they
are ambitions
</div>
</response>
<response id="3">
<divgreat peopele strive for greater things as well realised they
are ambitions
</div>
</response>
<htmlUpdateInst ruction>

<xsl:styleshe et version="1.0" xmlns:xsl="http ://www.w3.org/1999/XSL/
Transform" >
<xsl:param name="action" />
<xsl:template match="/">
<name <xsl:value-of select="/response"/>
</name>
</xsl:template>
</xsl:stylesheet>

</htmlUpdateInstr uction>

</responses>

=============== =============== =============== ========
Page below to be updated
=============== =============== =============== ========
<!-- <?xml version="1.0" encoding="UTF-8"?-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://
www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>TODO supply a title</title>
</head>
<body>
<a onClick="ava:aj axised()" >update page</a>
<div id="1">
TO update content from response 1
</div >
<div id="2">
TO update content response 2
</div >
<div id="3">
TO update content response 3
</div >
</p>
</body>
</html>


=============== =============== =============== ========
Processing the response(my ideas)
1. Using Javascript and DOM. i could update the various DIVS
2. Using XSL(embeded in xml of server reponse) and JavaScript. This is
an Idea but
can realise it only at server side. i don't know how to go about it at
the client side.
=============== =============== =============== ========
-thoughts.
1. get the embeded XSL in reponse to be used for transformation
2. use the initial html page as result of transformation
3. use the initial html page and the response (xml ) as transformation
source
4.problems writing the xsl( my idea is to loop through the reponse and
search the id, then check the html element with such and id if found
then update the content with that of the response)

I will be glad if someone can help me in any way.
thanks

Mar 15 '07 #1
1 3245
On Thu, 15 Mar 2007 12:20:29 +0100, MORALBAROMETER <su******@gmail .com
wrote:
Hi all,
I want to update MULTIPLE elements of an HTML page using Ajax. for
this reason i my response is an xml document. I want to use XSL at the
client side to update these elements. How can i achieve this?
I will be very greatefull for any help.
Have a look below
=============== =============== =============== ========
Response from Server using HttpRequest Object
=============== =============== =============== ========

<?xml version="1.0" encoding="UTF-8"?>
<responses>
<response id="1">
<divmy name is ivo sumelong in berlin and i will be coming to london
next week</div>
</response>
<response id="2">
<divgreat peopele strive for greater things as well realised they
are ambitions
</div>
</response>
<response id="3">
<divgreat peopele strive for greater things as well realised they
are ambitions
</div>
</response>
<htmlUpdateInst ruction>

<xsl:styleshe et version="1.0" xmlns:xsl="http ://www.w3.org/1999/XSL/
Transform" >
<xsl:param name="action" />
<xsl:template match="/">
<name <xsl:value-of select="/response"/>
</name>
</xsl:template>
</xsl:stylesheet>

</htmlUpdateInstr uction>

</responses>

=============== =============== =============== ========
Page below to be updated
=============== =============== =============== ========
<!-- <?xml version="1.0" encoding="UTF-8"?-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://
www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>TODO supply a title</title>
</head>
<body>
<a onClick="ava:aj axised()" >update page</a>
<div id="1">
TO update content from response 1
</div >
<div id="2">
TO update content response 2
</div >
<div id="3">
TO update content response 3
</div >
</p>
</body>
</html>


=============== =============== =============== ========
Processing the response(my ideas)
1. Using Javascript and DOM. i could update the various DIVS
2. Using XSL(embeded in xml of server reponse) and JavaScript. This is
an Idea but
can realise it only at server side. i don't know how to go about it at
the client side.
=============== =============== =============== ========
-thoughts.
1. get the embeded XSL in reponse to be used for transformation
2. use the initial html page as result of transformation
3. use the initial html page and the response (xml ) as transformation
source
4.problems writing the xsl( my idea is to loop through the reponse and
search the id, then check the html element with such and id if found
then update the content with that of the response)

I will be glad if someone can help me in any way.
thanks
Go with your first idea. This will work in all DOM-savvy browsers.

XSLT is not designed to run in a browser. Any browser implementation will
inevitably lead to compatibility problems.

--
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
Mar 18 '07 #2

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

Similar topics

2
39770
by: fmakopo | last post by:
I am trying to save html page using C# because i want to save the page on the server not on the client side. I can do that using Javascript the problem that i am having i want to save the page on the server.
5
2220
by: Martin | last post by:
Hello NG, I've been doing some AJAX for a few weeks now. The basics worked fine so far, but now I've got the following problem which I can't solve: With AJAX you typically update/replace only parts of your page. But in my application there are situation when I first notice on the server -- so AFTER sending an AJAX request -- that I have to update the complete page instead of only some parts. And what do I do now???
3
3060
by: mudgilgaurav | last post by:
I am very keen to learn AJAX and want to use it in my website Can anyone give me a bunch of code abt ajax and as well as tell me the flow of code
1
6674
nirmalsingh
by: nirmalsingh | last post by:
i am using ajax+c#+Mysql. with a table,textbox and save button. everything was inserted in database and loaded in table but the problem at rare timings i have to refresh html page to view saved data in table. plz help me to resolve this bug..
1
2131
by: shaji66 | last post by:
how to update values in HTML page using java script: hi all , I want to update some text fields in html , and display these values in another page .... can you please help me in writing java script can you please post code for it or give me perticular sites that can help me... thank you in advance...
1
1491
by: krishemanth | last post by:
sir, I want to update a value in dropdown using ajax i had a listing of some categories in dropdown along with that i had an add category in that dropdown box when select that addcategory option It opens a popup and add a new category and while submitting it popup closes and it automatically appends that value in drop down using ajax can any one send that code using ajax,I used javascript but the page is refreshing can it be possible...
2
1579
by: soms2m | last post by:
hello all, I am a just a beginer in this community also to this topic, i want to load a page using ajax. the parent should not be refreshed also its should have a dim background color which one i specify, also when loading another page the dim color should fill whole window. When the parent page increse in height the dim property should fill the incresed height.. Please give a solution for this, Thank u all...
1
2395
by: ashwani40 | last post by:
I am having a site in which dynamically header part is changing as in each and every page there is a script called which checks the referring url and according to that url script invoke a header.html which is used in AJAX and called as .txt file using XMLHttp.open . Complete HTML page is imported but if there is any javascript code exists in the header.txt. Javascript code does not get executed. Can any body help me out how to use...
1
1461
by: majid091 | last post by:
Hello, i want to extract only st paragraph of html page, only text not the images in the preview window when ever some one move the cursor to the link. Any solution ?
0
8826
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9366
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9316
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9241
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6793
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6073
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4597
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4867
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2211
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.