Calling all XML geeks
Jul. 26th, 2005 02:58 pmOkay, so I'm playing around with overhauling my site, and part of my overall goal here is to try to teach myself some XML--for purposes of trying to beef up my resume, of course, when I have to start looking for jobs again. And I'm looking for ways that I can put XML into use on this new and improved version of my site.
Here's the sitch--I have a known set of navigation links I want to display in different ways on my pages. For example, I may display them as a sidebar, or I may display them in a simpler form at the bottom of a page. But no matter how I display them, they should always have the same set of data, i.e., for each link, there should be a URL and a piece of text displayed for it. As near as I can tell this would be an ideal simple way to use XML, but a possible complication is that I use quite a bit of PHP on my site as well, and all of my various main files are PHP files.
So in short, what I want to do is something like this:
Is this doable? Tips and tricks appreciated!
Here's the sitch--I have a known set of navigation links I want to display in different ways on my pages. For example, I may display them as a sidebar, or I may display them in a simpler form at the bottom of a page. But no matter how I display them, they should always have the same set of data, i.e., for each link, there should be a URL and a piece of text displayed for it. As near as I can tell this would be an ideal simple way to use XML, but a possible complication is that I use quite a bit of PHP on my site as well, and all of my various main files are PHP files.
So in short, what I want to do is something like this:
- Have a file foo.php
- In various places in this file, bar.xml is pulled in, most likely via the PHP include() function
- Depending on where in the file I am, I need to pull bar.xml through one of a set of possible xslt stylesheets to spit out the proper HTML
- The final version of foo.php is tossed out to the user through the web server
Is this doable? Tips and tricks appreciated!
no subject
Date: 2005-07-26 11:24 pm (UTC)But I don't really know xml too well. I can ask Derrick if no one else does on your list (which I highly doubt).
I am fairly certain though, almost anything is possible. XD
no subject
Date: 2005-07-27 01:22 am (UTC)no subject
Date: 2005-07-27 01:23 am (UTC)no subject
Date: 2005-07-27 03:08 am (UTC)It's one of the very few areas that PHP has disappointed me. I was used to using the DOM for XML when I was progamming ASP pages (man... that's a geek sentence for sure). Alas, unless I've just missed something somewhere PHP doesn't do the DOM thang worth a hoot.
I understand that PHP 5.x does it at least somewhat better but my hosting service doesn't run 5 and I'm just not up to the task.
If you find the secret juju, please, please, please share it with me.
HH
no subject
Date: 2005-07-27 03:15 am (UTC)Anyway, thanks for your input! If I figure out anything cool, I shall be sure to geek about it here. Mostly at this stage, I want to do at least some playing with XML just to say that I have. It doesn't have to be too terribly complicated.