From 88bfab6cfddd8a6cd075f53666a2b7c6e9103030 Mon Sep 17 00:00:00 2001 From: Mark Pilgrim Date: Wed, 23 Sep 2009 08:38:43 -0400 Subject: [PATCH] typo (NSMAP) --- xml.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xml.html b/xml.html index 49046ec..8f98e9f 100755 --- a/xml.html +++ b/xml.html @@ -506,7 +506,7 @@ except ImportError: >>> entries [<Element {http://www.w3.org/2005/Atom}entry at e2b630>] >>> entry = entries[0] ->>> entry.xpath('./atom:title/text()', namespaces=nsmap) +>>> entry.xpath('./atom:title/text()', namespaces=NSMAP) ['Accessibility is a harsh mistress']
  1. To perform XPath queries on namespaced elements, you need to define a namespace prefix mapping. This is just a Python dictionary.