Entries classified under xml


Apple - iTunes - Podcasting
- bout' time
United States Patent: 6,880,125
- "System and method for XML parsing" - BEA Systems, Inc.
To links xml coding patent funny web ... on Wed 04/13/05 at 09:38 PM

Kid 0.6

Kid 0.6 is available.

This is a feature release with some pretty important enhancements including Template Inheritence, Match Templates (kind of like XSLT's), cElementTree support, and a refined Python API. Quite a bit of time was spent on the documentation as well.

The Release Notes have more information on everything that has changed.

Kid is an XML based template language for Python that merges the best of Zope's TAL, PHP, and XSLT into a single coherent package. It was created to provide a simple method of generating dynamic, well-formed XML documents using familiar concepts from popular text templating languages.

Download

http://lesscode.org/dist/kid/

Release Notes

http://lesscode.org/doc/kid/0.6/notes.html

Project Information

http://lesscode.org/projects/kid/

To weblog coding python kid splice xml ... on Sat 03/05/05 at 10:49 AM

Show Me the Code
- Joe Gregorio's second installment in his series on building RESTful applications shows us how to build a bookmark service kind of like del.icio.us. He nailed this one really nicely.
To links coding ws web rest xml ... on Thu 03/03/05 at 05:30 AM

Yahoo! Launches REST-based Web Services

Yahoo! launched a Web Services interface today. I'm gushing with joy over their decision to follow proven web architecture and select a simple REST model over a more complex WS-* model. Let's take a look at an item pulled from their FAQ:

Q: Does Yahoo! plan to support SOAP?

Not at this time. We may provide SOAP interfaces in the future, if there is significant demand. We believe REST has a lower barrier to entry, is easier to use than SOAP, and is entirely sufficient for these services.

Get used to that answer. You won't ever hear it from the evil tool vendors but you can be damn sure you'll be hearing it from the smart service providers that really are looking to court developers.

Also, it was extremely cool to serendipitously stumble across mine own How I explained REST to my wife article after passing from Yahoo!'s Constructing REST Requests page to Wikipedia's REST page.

To weblog coding web ws rest soap xml ... on Tue 03/01/05 at 09:27 AM

XForms Add-On for Mozilla Coming Soon
- bout time..
To links xml xforms web moz coding ... on Tue 01/25/05 at 07:44 PM

ElementTree on the come-up

I had a very small number of complaints related to basing Kid on ElementTree. This came in two forms:

  1. SAX and DOM are “standard” and while ElementTree is a drastically improved system for processing XML in Python, it doesn't matter because everyone already knows SAX/DOM.

  2. “libxml2 is teh rawk!”

First, if Python's W3C DOM standard based xml.dom package were a movie, it would be called Elf, staring xml.dom. It's the episode of Little House on the Prairie where Alien asks Michael Landon for permission to marry his daughter. It does not belong here!

Next, in terms of pythonicness, libxml2 is almost worse than xml.dom but you at least get something for it: they don't even have a word to describe this level of “fast” and it comes along with XPath, RelaxNG, XSD, XML-Base, XInclude, and XSLT. My issue with libxml2 is just that it's a bad dependency for a project like Kid that wants to be able to run on cheap web space with bare-bones Python support. There are a lot of hosting providers that aren't going to have libxml2 or the option of compiling from source.

I went with ElementTree because it's simple, pythonic, and fast enough. I also had a feeling we'd be seeing more development around ElementTree, which brings us nicely to why I'm posting.

To weblog coding python xml kid ... on Wed 01/12/05 at 10:46 AM

How I explained REST to my wife...

Some days the Powerbook gets more attention than the wife and so she snoops over my shoulder and starts asking a bunch of questions about whatever is on the screen. She doesn't really care, this is just the cue to shift my attention over to her. I usually do just that and say something like, Oh, this is some interesting stuff but nothing you would care about.

But on this day I decided that I would play along a bit and see how far I could take her into my world before she ran away screaming in terror.

To weblog coding web ws rest soap xml ... on Sun 12/12/04 at 12:30 PM

More on cross-breading ZPT and XSLT - Transformation Templates in Kid

This is the second post in response to cross-breading ZPT and XSLT. I'd like to dig into how I'd like templating to work in Kid and Leslie opens the door for me:

... maybe this is the sort of thing Ryan's thinking about-- I wonder how hard it would be to hack this into Kid? It would give only a subset of XSLT's capabilities in trade for simplicity, and would only offer the pull approach, but it would give XML-pipelining to a ZPT-ish technology.

To weblog coding python xml kid splice ... on Sat 12/11/04 at 05:31 AM

Why isn't there a simple XSLT?

Leslie de 0xDECAFBAD talks a bit about cross-breading ZPT and XSLT and mentions Kid along the way. This is the first in a series of response posts.

To weblog kid splice python xml ... on Fri 12/10/04 at 11:16 PM

XML Pull-chaining with Python

So this is pretty crazy. I'm messing around with ElementTree (which has been nothing less than perfect) and trying to get it to act like a xml.dom.pulldom/XmlTextReader style pull-parser. But I'd like to be able to assemble a chain of generator producing/consuming functions (or other callable) so that the file can be read, parsed, filtered/mutated, encoded, and written all incrementally.

Check it out:

import sys
import pulltree    # that's what I'm working on :)

def upper_filter(source):
    for (ev, item) in source:
        if ev == pulltree.CHARACTERS:
            item = item.upper()
        yield (ev, item)

reader = pulltree.reader(sys.stdin)
filter = upper_filter(reader)
writer = pulltree.writer(filter, sys.stdout)

for (ev, item) in writer:
    pass

C-z

$ echo "<hello>world</hello>" | python test_filter.py 
<hello>WORLD</hello>

That felt good. More functional than a chain of SAX XMLFilters, almost as efficient, and muuuuch perdier.

Something like this might work someday soon:

import urllib2
from pulltree

XINCLUDE = '{http://www.w3.org/2001/XInclude}include'

def xinclude_filter(source):
    events = iter(source)
    for (event, item) in events:
        if event == pulltree.START_ELEMENT and elm.tag == XINCLUDE:
           href = item.attrib['href']
           for woot in pulltree.reader(urllib2.urlopen(href))
               yield woot
           pulltree.eat(elm, events) # eat events to the end of the element
        yield (ev, elm)

Granted, that's as basic an XInclude processor could be and still be useful but you get the point.

To python coding xml weblog ... on Sun 12/05/04 at 12:08 PM

Kid 0.2 and a note on Template Design

I pushed up a much needed 0.2 release of Kid today. I hadn't meant for my previous post to be an announcement but I got quite a few comments showing interest and was surprised to see some people actually grabbing the 0.1.1 release. As it was, for all intents and purposes, not a release at all. The 0.2 release should be somewhat more stable. At least enough to dive in and play around.

To kid splice coding python weblog xml ... on Thu 12/02/04 at 09:56 AM

In search of a Pythonic, XML-based Templating Language

I've been searching for the perfect Python based XML template language. I was happy to find TAL (and specifically, SimpleTAL) a while back but, although neither of us wants to admit it, we've been growing apart for some time now. I spent last week looking for options and, after careful consideration and planning (read: beer and a nap), decided to just build the XML template language I really wanted.

There's at least four billion and nine text based template languages for Python but there aren't a lot of options that fit nicely into the XML tool-chain. Or, if they do fit nicely into the XML tool-chain, they don't fit nicely with Python.

My dreamboat XML template language would combine the pythonicness and simplicity of PTL, the templating features and pipeline-ability of XSLT, and the terseness of Zope's TAL. I'm building it, it's called Kid, and I'm making good progress to be honest.

But I have this overwhelming NIH feeling so I've decided the best thing to do is to run through the current set of tools and take a professional, objective look at why each isn't getting it done for me (i.e. make fun of minor flaws and limitations until I feel better about myself). Herewith, a look at the good and the bad in the Python XML templating space...

To coding python xml kid splice weblog ... on Tue 11/30/04 at 07:06 AM

Metacrap
- I love this paper...
To links coding essays web xml ... on Sun 11/07/04 at 06:18 AM
On Semantics and Markup
- More goodness from the archives of Tim Bray.
To links coding html web xml ... on Mon 09/20/04 at 05:06 AM
XML/XSLT/CSS/JavaScript/ Treeview component..
- ..that rocks. Quite possible the only javascript treeview I'd ever consider using.
To links css html javascript web xml xslt ... on Fri 09/10/04 at 08:29 PM
The Atom Syndication Format 0.3
- I know it says 0.2 in the URL and PRE-DRAFT in the title but this as normative as you can get with the 0.3 feeds in the wild.
Wrestling HTML
- XML.com: Dealing with tagsoup HTML in Python.
To links coding html python xml ... on Thu 09/09/04 at 06:56 PM
Scimitar - A Python implementation of ISO Schematron
- Uche Ogbuji. Compiles schematron schema to python.
To links python xml ... on Wed 09/01/04 at 01:28 AM
XML Path Language (XPath)
- W3C Recommendation 16 November 1999
To links spec xml ... on Sun 08/29/04 at 07:42 AM
XSL Transformations (XSLT)
- W3C Recommendation.
To links spec xml xslt ... on Thu 08/26/04 at 05:30 PM
TAL/TALES & METAL Reference Guide
- SimpleTAL reference.
To links reference web xml ... on Wed 08/25/04 at 03:07 AM
Identifying Atom [xml.com]
- atom:id will use URIs (hurray). markp explains why.
To links atom blogging xml ... on Thu 08/19/04 at 01:35 PM
Implementing REST Web Services: Best Practices and Guidelines
To links rest todo web xml ... on Thu 08/12/04 at 06:30 AM
Gallery of Stupid XSL/XSLT Tricks
To links web xml xslt ... on Sun 08/01/04 at 11:44 AM
Proper XML Output in Python [xml.com]
- On entity substitution and whatnot..
To links oldnews python xml ... on Sun 08/01/04 at 10:16 AM
XHTML Frequently Answered Questions
To links web xml ... on Fri 07/23/04 at 06:50 PM
Introducing o:XML [xml.com]
- Oh God, please no. XML is not fun to program in!
To links xml ... on Thu 07/22/04 at 02:43 PM
XML on the Web Has Failed [xml.com]
- "Syndicated feeds are wildly popular, but they're not a success for XML. XML on the Web has failed: miserably, utterly, and completely."
To links web xml ... on Wed 07/21/04 at 09:10 PM
Mastering DocBook Indexes
To links docbook xml ... on Wed 07/21/04 at 07:04 PM