| | |
updating pages with XML- "forthcoming events info"
Please support our RSS, Web Services and SOAP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
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
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.
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.
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.
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 5:10 pm.
Plato forgot the nullahedron..
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.
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.
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.
RSS, Web Services and SOAP Syntax (Toggle Plain Text)
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.
![]() |
Similar Threads
- "scheduled events"(mstask) - Where they are stored (Windows 95 / 98 / Me)
- google "keyword" question (Search Engine Optimization)
- Removal of "Home Search Assistant", "Search Extender", & "Shopping Wizard" (Viruses, Spyware and other Nasties)
- "Home Search 'Assistent'"... yet again (Viruses, Spyware and other Nasties)
- more "home search assistent" fun... (Viruses, Spyware and other Nasties)
Other Threads in the RSS, Web Services and SOAP Forum
- Previous Thread: Soap
- Next Thread: Apache SOAP Server startup issue
| Thread Tools | Search this Thread |
.htaccess 301 accept access alltop api authentication binarysecuritytoken blog card collaboration credit data development ebay email evernote flash google government highrise htaccess intel internet legal live netbeans patent paypal php podcast proxy redirect rss rssfeeds searchmonkey server service soap software swappingxmlfromflash swappingxmlnodes url web webservices webservicesecurity wiki wikipedia xerces xml xslt y!os yahoo ydn






