| |||||||||||
XML Posted by Garrie (Garrie), 7 October 2002 Can anyone recommend a good place to start learning about XML?I've looked at a number of websites and I am still confused about how to use XML. In particular, how to use XML to generate dynamic webpages. - Garrie Posted by John_Moylan (jfp), 7 October 2002 A good primer(s) for XML can be found at:http://www.topxml.com/xml/learnxml.asp XML is a way of saving your content/data in a structured form within a text doc or database. You then parse the XML tags to extract the relevant data, what you do with it is up to you, but as you mentioned in your post generating web pages is a popular use for XML. eg: extract your XML data and sent it to an html template to build and deploy your html page. (This is a separation of content, logic and presentation, and is a good thing) XML = Content Programming lang = Logic presentation = Template The bit that does the parsing and building could be wriiten in any language, popular examples being "Perl, php, java". You really need to decide on a language before specifics can be given on generating dynamic content, but php would be a nice easy route. (www.php.net) jfp Posted by Garrie (Garrie), 7 October 2002 Thanks I'll have a look.It will probably be PHP I'll use to generate the pages. So any help along those lines will be appreciated. - Garrie Posted by John_Moylan (jfp), 7 October 2002 Then I'll point you towards some urls and a good book.I've not personally used the sites tutorials as I prefer my tutorials to come from tree's. Url's: http://www.zend.com/zend/tut/tutbarlach.php http://www.analysisandsolutions.com/code/phpxml.htm Books: Beginning PHP4, published by WROX (make sure its PHP4, there is a older version of the book still being sold) is a good primer for php and includes a section on XML parsing. No talk on templating here though, but I suggest you look at http://smarty.php.net/ for starters, there is another called fast template but smarty is faster and more extendable. Have the appropriate amound of fun. jfp Posted by admin (Graham Ellis), 8 October 2002 For formatting data that's held in XML format, you probably want to have a look at XSLT (XML Stylesheet Language Transforms).An XSLT document is a set of directives telling a formatter how to handle data found in an XML document, and it's written in XML itself, using a specific tag set that ensures that it's XSLT. Perhaps an example would help? Here's a file of XML: Code:
Here's the XSLT that I might use to translate it into HTML: Code:
And here's a Perl program to do the conversion: Code:
This page is a thread posted to the opentalk forum
at www.opentalk.org.uk and
archived here for reference. To jump to the archive index please
follow this link.
|
| ||||||||||
PH: 01144 1225 708225 • FAX: 01144 1225 793803 • EMAIL: info@wellho.net • WEB: http://www.wellho.net • SKYPE: wellho |