102 posts tagged “xml”
2004
Designing Extensible, Versionable XML Formats. Advice from Dare Obasanjo.
XML on the Web Has Failed. Mark Pilgrim concludes a theme he’s been following for quite a while.
Processing XML with JavaScript. My notes on Sarissa and Mozilla’s XML Extras.
Why XML served as text/plain is not well-formed (via) Apparently plain text is intended to be displayed “as-is”.
Using the XML HTTP Request object (via) Recently updated to include Safari as well.
XMLStarlet Command Line XML Toolkit (via) Process XML with Unix pipes.
PHP, XML, and Character Encodings: a tale of sadness, rage, and (data-)loss (via) Fixing some very funky behaviour in PHP’s XML parser.
The orange XML icon sucks
I’m not a fan of the orange XML icon, even though I use it on my categories page. I love the concept of a universally recognised icon for RSS feeds, but XML is simply the wrong acronym to put on it. Don’t think it’s liable to cause confusion? Check out this excerpt from Journalism.co.uk (emphasis mine):
[... 160 words]XCP—the XML Control Protocol. TCP/IP replacement—with added angle brackets!
XML Namespaces Support in Python Tools (via) Expert analysis from Uche Ogbuji.
PHP 5 Release Candidate 1
I haven’t blogged much about PHP in a while because I’ve been up to my nose in mod_python and loving every minute of it. This news is just too important to miss: PHP 5 Release Candidate 1 has been released, bringing the first production-ready release tantilisingly close. While I doubt PHP 5 will tempt me back it’s definitely an exciting upgrade—my biggest complaint with PHP 4 is the brain-dead object model which defaults to copying whole objects rather than passing references, and this is one of the many things addressed by PHP 5. The new libxml2 powered XML features sound really powerful, and SQLite as an on-board database should be ideal for knocking out small stand-alone applications without needing to set up a mySQL database for them.
[... 173 words]XML.com: Lightweight XML Search Servers [Jan. 21, 2004] (via) More fun with Python and libxml2
Ned Batchelder: handyxml. Yet another XML object wrapper for Python, this time with full DOM method support included
When Word-to-XML conversion gets nasty. “it is impossible to automatically convert unstructured sources into structured formats”
2003
XML highlights for PHP 5
XML in PHP5: An in-depth look into advanced XML features (via Keith) does exactly what it says on the tin. Here are the bits that caught my eye:
[... 155 words]XML in PHP5 (via) An in-depth look into advanced XML features
On Search: XML. Tim Bray on search and XML? You know it’s going to be good.
Using XPath to mine XHTML
This morning, I finally decided to install libxml2 and see what all the fuss was about, in particular with respect to XPath. What followed is best described as an enlightening experience.
[... 576 words]XML textarea validation bookmarklet
Jesse Ruderman’s Blogidate bookmarklets cycle through all of the textareas on the current page and submit their contents for validation. I suggested an alternative approach, and to my great delight has has followed it up with the essential Blogidate XML well-formedness. One click, and each textarea on the page will be checked to see if it contains valid XHTML. If it does, the background goes green—if not, it goes red. Hopefully I’ll never post another invalid entry (my previous solution broke when I switched to application/xml+xhtml
).
Compact XML Schemas with Relax NG
Tim Bray has cooked up a RelaxNG schema for the 0.1 Necho/Pie/Fecho/!Echo snapshot (they really need to hurry up and decide on a name). I had never looked at RelaxNG before, although I had vaguely picked up that it was a lot nicer than the W3C’s XML Schema format. Tim has used RelaxNG Compact, a shorthand method of writing schemas that uses a curly-braces style language instead of XML. It’s suddenly got me very interested—the compact format is instantly readable and looks a lot more efficient to use than DTDs or an XML schema language. Best of all, there are tools to instantly convert compact syntax in to a full RelaxNG XML schema, and then convert that in to XML Schema (should you want to do so). The Compact Syntax tutorial gives a good overview of how the compact syntax works. Now if only there was a Relax NG validation tool in PHP...
Custom XML templating with PHP
Dynamic XML conversion using the SAX parser and a stack is the best new article I’ve seen on PHPBuilder in a very long time. It introduces several interesting ideas. The first is something I’ve been thinking about for a while now: using PHP’s output buffering to implement a kind of templating system so that all of the scripts in a system just have to generate an intermediate content type, then the output buffering function adds on the HTML framework and finalises the page. The second idea is ingenious: invent XML elements to represent specific behaviours, then handle them with a SAX before the page is displayed. Here’s some example code from the article:
[... 280 words]XML Shorthand Language
Via Keith, PXSL, the Parsimonious XML Shorthand Language provides a shorthand way of writing and maintaining XML documents. It’s based around the idea that a lot of XML formats contain more markup than actual text, thus by reversing the way the syntax is formatted and using meaningful indentation to express hierarchies markup heavy XML can be greatly simplified.
XmlWriter: Generating XML from PHP
Lars Marius Garshol’s XMLWriter class for Python struck me as a particularly elegant solution for generating simple XML documents without having to worry about encoding issues, missing tags and so forth—so I re-implemented it in PHP:
[... 112 words]Why XML doesn’t suck
Tim Bray: Why XML Doesn’t Suck (a follow up to XML Is Too Hard For Programmers). I’d quote the best bits but there are just too many—this article clears up all of the loose ends in my understanding of why XML is such an important technology.
More YAML
Paul Tchistopolskii’s XML Alternatives reminded me to take another look at YAML. The specification has been updated since I last looked and seems to be a bit more complicated, but it’s still a very nicely designed format. Implementations are available for Perl, Python and Ruby with C and Java on the way but strangely no one seems to be doing one for PHP yet. I’m doing a course at Uni on compilers at the moment which includes quite a lot of stuff about writing parsers so I’m very tempted to have a go at a YAML implementation in the next few weeks just to try stuff out. The possibility of easily swapping relatively complex data structures between PHP and Python is pretty tempting as well.
XHTML is just fine
In Who dropped the deat cat into the well? (via Mark Pilgrim), Brian Donovan argues that keeping web site content in (X)HTML is a fundamentally bad idea. I thoroughly disagree. When I started this weblog, I realised I needed a format for storing my entries that would keep my content “free” to be reused in multiple different ways. I thought about a simple UBB style markup language, with [url="http://www.example.com/"]links like this[/url]
, automatic line breaks and a few other simple structures such as lists and headings. I also considered Wiki markup of some sort, again looking for a reasonable expressive but controlled markup vocabulary for storing my blog entries in a reusable way.
2002
XML security on SitePoint
Getting Started with XML Security is a SitePoint article of epic proportions. I had never really looked at any of the XML security applications but this article appears to cover the lot.
Javascript XML parser
I’ve added Dave Lindquist’s Javascript XML parser to my blog entry form using the code he posted in the discussion on webgraphics. It works an absolute treat—it even pops up an alert message telling me what is wrong with the post (usually ’End tag does not match opening tag’) and won’t let me submit the form until I have fixed the error. The actual XML parsing library is a truly impressive piece of work, despite the lack of documentation. Dave suggests that it is pretty much obsolete now that most modern browsers have a built in XML parser accessible through scripting, but his parser is easily fast enough for my purposes.
Validating weblog entries
webgraphics have an interesting discussion running about the need for a weblog entry XHTML validator. Dave Lindquist suggests using his JavaScript XML Parser to perform validation on the client side, which seems like an excellent solution. I already use PHP’s XML parsing functions on this blog to check my entries are valid XML when I post them (and extract links for use with my pingback client) but additional client side validation would save the round trip to the server. The discussion also covers the idea of using the W3C’s validator to check entries—as soon as they finalise their XML interface (as used by my validator web service) I can see a lot of interest forming in this kind of automated validation.
Inline XML
Inline XML explains how different XML languages can be embedded in XHTML documents using namespaces, and how they can then by styled using CSS.