telophase: (Default)
telophase ([personal profile] telophase) wrote2009-10-30 05:02 pm
Entry tags:

(no subject)

Does anyone here know anything about XML and XSLT? Specifically, how to use functions?

More specifically, I've got an XML file (Atom feed) that contains this:

<published>2009-10-29T21:11:09Z</published>

I need to turn that into something human-readable. My knowledge of XSLT extends solely to the ability to select pieces of text out of a string like that: i.e. I can make "2009-10-29T21:11:09Z" appear on the page. If I want to get ambitious, I can put HTML tags around it. That's it. And an hour and a half of perusing the Web has done nothing but start to bring my migraine back.


And I'm now off to [livejournal.com profile] puppleball's birthday celebration, and will return at some point. Anything anyone knows would be helpful - I can find lots of lists of functions for XSLT, but not a single word on HOW to use them.
thistleingrey: (Default)

[personal profile] thistleingrey 2009-10-31 02:17 am (UTC)(link)
...But it is human-readable, says my first reaction. Uh. I am not good with xsl:analyze-string, but that's one way to get it: analyze the CDATA, pull out the first part (date), pull out the second and drop the seconds if you don't need them. Did you happen upon this link, and does its second half make sense?

I use XSLT to manipulate XML into XHTML+CSS that does my bidding, but text-transformation is it--not much scripty/programming things. That brings up another question: is it not possible in this context to use Perl/similar? Seems as though that'd be easier.)

[identity profile] cerusee.livejournal.com 2009-10-30 11:17 pm (UTC)(link)
Ahaha, I just got back from Metadata class! Last week, we encoded CCO or DACS records into MODS and ran them through XSLT to produce nice, human-readable webpages!

That said, I can offer no more helpful advice than to get an XML editor and run your thing through its style sheet. No clue how to handle it otherwise.

(By the by, according to the devotees of XML, that IS human readable, and isn't it awesome? If you speak English. If you don't, you can just write your own damn metadata format. Or so I assume. It never seems to come up, for some reason.)

[identity profile] tammylee.livejournal.com 2009-10-31 02:47 am (UTC)(link)
[livejournal.com profile] spubba works with that sort of thing, I believe!
She might be willing to help you out?