annathepiper: (Default)
[personal profile] annathepiper
Okay, 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:

  • 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!

Date: 2005-07-26 11:24 pm (UTC)
From: [identity profile] spunbutterfly.livejournal.com
I think it's possible in just php and css.

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
(deleted comment)

Date: 2005-07-27 03:08 am (UTC)
From: [identity profile] howlinhobbit.livejournal.com
PHP does simple XML stuff reasonably well but falls down hard on anything complex.

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

Profile

annathepiper: (Default)
Anna the Piper

November 2025

S M T W T F S
      1
2345678
9101112131415
16171819202122
23242526272829
30      

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Mar. 14th, 2026 04:46 pm
Powered by Dreamwidth Studios