Web Hosting Talk







View Full Version : XML Checklist


spacely
01-08-2005, 09:10 PM
I understand what XML is about. I even have the url of the xml file I want to display on my site.

What I need some help with is understanding the steps involved in transforming the file supplied by a data provider into a readable format on a web page. Simplicity is favored over functionality. I am not looking for specific code - just a sort of checklist of what needs to be done.

Burhan
01-09-2005, 02:58 AM
There are a few ways you can approach this problem.

The simplest would be to create a xsl file (that's xml stylesheet) and then edit your xml file so that it uses the stylesheet to format its contents.

This approach requires a bit of xml/xpath knowledge, but there are a lot of tutorials out there that can help you with that.

The other approach, which allows for greater flexibility, would be to write your own xml parser "hook" to read the file and then format it however you like. This is not as difficult as the above method, but requires (obviously) some programming knowledge. <plug type="shameless">I have an article at devpapers (http://www.devpapers.com/article/61) that shows you how to parse xml using PHP</plug>.

Lots of options for you, it just depends on what you want to do with xml.

spacely
01-09-2005, 06:16 PM
Well it was a shameless plug, but your article was at exactly the level I needed. I got it working, it just needs prettied up a bit now. By the way, the links in the article to download your sample, etc. are broken. It's not so hard to paste it all together though.

Burhan
01-10-2005, 05:01 AM
Oops, I forgot when I took my server down, the links when down with it. I'll put the code back up.

spacely
01-12-2005, 10:04 PM
Based on the help above I was able to pull in and display an external xml file. But now I want to do some monkeying with it. I think I understand xsl enough to get that working for me. The trick, for me anyway, is to get the two files to play well together in php.

I have seen examples done a couple different ways. Depending on which method I try I get one of these two errors:

1) undefined function: xslt_create()
or
2) Cannot instantiate non-existent class: xsltprocessor

Am I missing something obvious?

Burhan
01-13-2005, 03:07 AM
Sounds like your PHP install is missing XSL support. Verify your PHP setup with phpinfo();

spacely
01-13-2005, 11:07 AM
I looked through what phpinfo();gave me and there was no mention of xsl or xslt anywhere. What module would I need to install?