User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the RSS, Web Services and SOAP section within the Web Development category of DaniWeb, a massive community of 422,560 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 4,671 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our RSS, Web Services and SOAP advertiser: Programming Forums
Views: 2360 | Replies: 2
Reply
Join Date: Feb 2005
Location: England
Posts: 91
Reputation: NuGG is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 0
NuGG's Avatar
NuGG NuGG is offline Offline
Junior Poster in Training

Help updating pages with XML- "forthcoming events info"

  #1  
Nov 2nd, 2006
I have multiple pages with the same information on them (forthcoming events information), and when that information needs to be changed i have to change every page which takes time. I was wondering if XML can be used to change the information on the pages by editing one central XML file, which will save me alot of time and hassle when updating the site. I have never done any work with XML before, however i have a good understanding of html and know a little javascript.

Please be aware that the information will have to be displayed in a html file. I would use asp and a database to do this, however my webhosting service will not alow the use of asp.

If anyone can give me a few tips on how this can be done it would be greatly appreciated.

Thanks for your time,

NuGG
Pubonwheels - Mobile Bar Services for the South West of England.
The Kings Head Inn - The Kings Head, Underhill, Coleford, Somerset, UK.
South West Ravers - Going out to all you jungle drum and bass ravers.
UFB Live Radio - Keep It Locked.
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Jul 2006
Location: Deptford, London
Posts: 954
Reputation: MattEvans has a spectacular aura about MattEvans has a spectacular aura about 
Rep Power: 5
Solved Threads: 48
Moderator
Featured Poster
MattEvans's Avatar
MattEvans MattEvans is offline Offline
Posting Shark

Re: updating pages with XML- "forthcoming events info"

  #2  
Nov 27th, 2006
You should look into XML Stylesheet Language Transformations (XSLT for short).

http://www.w3.org/TR/xslt ...this is a good reference
http://www.w3schools.com/xsl/ ..and this is a good introduction

I would advise building the pages using an offline XSLT processor, as client side (browser) XSLT processors are at best; bad.

EDIT: Or, you could use the PHP XSLT module. IF it's installed on your server.

I make alot of pages using offline XSLT processors (Xalan + Xerces) to create static HTML pages - but they are command line tools, and you need to understand XSL to use them...

For learning, you can create XML files, link them to XSL stylesheets and test them in certain browsers (Internet Explorer and Firefox) bear in mind, that the browser is doing work that is conventionally regarded as a "server side job", and that has a number of implications, the biggest I guess is that some browsers (i.e. Opera) don't have XSLT processors, and search engines can't make head or tail of your pages.

If you need any help when you're using XSL (setup, nuances, etc) let me know, I've been using it for a while now; for pages that are too static to be considered dynamic and to dynamic to be considered static.
Last edited by MattEvans : Nov 27th, 2006 at 4:10 pm.
If it only works in Internet Explorer; it doesn't work.
Reply With Quote  
Join Date: Nov 2004
Location: Netherlands
Posts: 5,752
Reputation: jwenting is a jewel in the rough jwenting is a jewel in the rough jwenting is a jewel in the rough jwenting is a jewel in the rough 
Rep Power: 18
Solved Threads: 197
Colleague
jwenting's Avatar
jwenting jwenting is offline Offline
duckman

Re: updating pages with XML- "forthcoming events info"

  #3  
Dec 2nd, 2006
Do be advised that on the fly XSLT transformation can be very slow, unless you take care to cache the precompiled XSLT files between invocations.

I've done testing for that in the past.
I've actually written a system doing as Matt suggests in Java, using XSLT on a fairly large scale to process dynamically generated XML into html output (and some things into PDF using XSL:FO).

Without caching the compiled XSLT files between requests the request/response cycle was several orders of magnitude slower as compared to the situation after I had implemented such caching.
The compilation stage was that slow, the actual processing itself was extremely fast.

    TransformerFactory tFactory = TransformerFactory.newInstance();
      // Get the XML input document and the stylesheet.
      Source xmlSource = new DOMSource(xmlInput);
      Source xslSource = new StreamSource(xslFile);
      // Generate the transformer.
      Transformer transformer = tFactory.newTransformer(xslSource);
      // Perform the transformation, sending the output to the response.
      transformer.transform(xmlSource, new StreamResult(out));

You will want to cache the Transformer here in some way and reuse it.
In the final version of that system I used a simple HashMap using the filename of the XSLT file as a key.
As people are clearly allowed to attack me but I'm not allowed to defend myself, I no longer post to this site.
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb RSS, Web Services and SOAP Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the RSS, Web Services and SOAP Forum

All times are GMT -4. The time now is 1:19 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC