xml

PHP Array To XML

I needed a quick, perhaps even sloppy way to output an array as XML. Some Googling turned up a few tools, including Simon Willison’s XmlWriter, Johnny Brochard’s Array 2 XML, Roger Veciana Associative array to XML, and Gijs van Tulder’s Array to XML. Finally, Gijs also pointed me to the XML_Serializer PEAR Package.

In an example of how even the smallest barriers can turn people away, I completely ignored the two possible solutions at PHP Classes, because navigating and using the site sucks. I passed on Willison’s function because, well, it didn’t look like it would do enough of what I wanted. Despite Gijs’ recommendation of the PEAR module, I was happy enough to use his array_to_xml function, as it did what I needed and required the lest work for the moment. I may revisit XML_Serializer sometime, but…

Technology Scouts At AALL

I’m honored to join Katie Bauer, of Yale University Library, in a program coordinated by Mary Jane Kelsey, of Yale Law’s Lillian Goldman Library. The full title of our program is Technology Scouts: how to keep your library and ILS current in the IT world (H-4, 4PM Tuesday, room 274). My portion of the presentation […] » about 300 words

PHP5’s SimpleXML Now Passes CDATA Content

I didn’t hear big announcement of it, but deep in the docs (? PHP 5.1.0) you’ll find a note about additional Libxml parameters. In there you’ll learn about “LIBXML_NOCDATA,” and it works like this:

simplexml_load_string($xmlraw, 'SimpleXMLElement', LIBXML_NOCDATA);

Without that option (and with all previous versions of PHP/SimpleXML), SimpleXML just ignores any < ![CDATA[…]]> ‘escaped’ content, such as you’ll find in most every blog feed.

OPAC Web Services Should Be Like Amazon Web Services

No, I’m not talking about the interface our users see in the web browser — there’s enough argument about that — I’m talking about web services, the technologies that form much of the infrastructure for Web 2.0. Once upon a time, the technology that displayed a set of data, let’s say catalog records, was inextricably […] » about 900 words

Using XML In PHP5

Everybody likes documentation. The Zend folks posted this overview and SimpleXML introduction The O’Reilly folks at ONLamp offered this guide to using SimpleXML. Of course, there’s always the SimpleXML docs at PHP.net.

Two problems: I haven’t encountered CDATA in my XML yet, but I do hope to develop a better solution than offered here when I do. The other is that SimpleXML chokes on illegal characters, a unfortunately common occurrence in documents coming from III’s XML Server.

Library-Related Geekery

Ryan beat me to reporting on the interesting new services at the Ockham Network (noted in this Web4lib post). The easiest one to grok is this spelling service, but there are others that are cooler. He also alerted me to a Perl script to proxy Z39.50 to RSS. Though for those more into PHP (like […] » about 300 words

iTunes Music Store API?

I can’t explain why, at least not yet, but I’m looking for a way to search the iTunes Music Store catalog outside of iTunes. Rumors of an iTunes-Google partnership have been flying lately, but what I really want is a webservice/API I can use. Yes, Apple offers an affiliate program that supports direct links, but […] » about 400 words