XML content fed into a HTML page

C

ChronicFatigue

Have read some basic tutorials on xml and understand that xml is a markup
language used to describe data using tags which can be defined by the user.
Am about to start work on a content rich information site which will be
dynamic using php and mysql for many of the sites functions.

From what I can gather I have a number of options to get the content into
the webpages:

1. Feed content from a database into the web pages
2. Create content in conventional html pages with php templates to write the
surrounding navigation and site features into the rest of the page

But can XML be used instead?

How would xml be used to get the content from an xml page into the site?

Would it be easier to just use one of the methods listed above? At the
moment I am veering towards method number 2.

Does anyone have any links to xml tutorials which demonstrate how to feed
content written in xml format into a html document?

Am I barking (mad) up the wrong tree?!

Answers on a postcard

Simon
 
A

Andy Dingley

Am I barking (mad) up the wrong tree?!

No, this is an excellent approach.
Answers on a postcard

Sorry, it's too big !

I'd love to explain everything in huge detail - but there's work to
do, and I'm basically avoiding it, so I don't have time. 8-(


High level:

Take content out of database. Use programmatic code (PHP / ASP / JSP
/ whatever you like) to write it into an XML DOM.

Generate this XML according to a Schema. Choose your schema by
borrowing an existing one, in preference to inventing one

On the server, use XSLT to transform this to HTML. Return the HTML to
the client..


Bad things to do:

Use CSS to "style" the XML on the client. Far too inflexible.

Use XSLT on the _client_. Works beautifully, but only under IE. Good
for some intranets though.

Generate XML without using a DOM.

Use RSS 2.0

Good things to do:

Borrow schemas. Glue suitable schemas together from all over the place
(DocBook (not much use though), XHTML (hey, it's a text markup
language), RSS 1.0)

Use client-side XSLT, but only if browser-type sniffing confirms a
suitable browser. Make sure you have a non-client backup.

Realise that your site is basically a weblog with bells on, and
implement the whole thing with MovableType and not writing the code
yourself. Result !
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,754
Messages
2,569,521
Members
44,995
Latest member
PinupduzSap

Latest Threads

Top