amara

Python xpath not working?

Okay, this is starting to drive me a little bit nuts. I've tried several xml/xpath libraries for Python, and can't figure out a simple way to get a stinkin' "title" element. The latest attempt looks like this (using Amara): def view(req, url): req.content_type = 'text/plain' doc = amara.parse(urlopen(url)) for node in doc.x...

Python Amara package does not install with Bindery

I've installed virtualenv in the home directory of a shared university server so that I can install custom packages I need for my application (SQLAlchemy and Amara, most importantly). SQLAlchemy works just fine, but Amara (2.0a4) refuses to cooperate. For some reason, using the virtual environment's easy_install amara command, the Binde...

amara and django

Hello I am trying to do webservice calls with django views using Amara library. However anytime I do import amara (by simply importing it!) and call a django view with it imported, I get such errors: Environment: Request Method: GET Request URL: http://127.0.0.1:4444/test Django Version: 1.2.1 Python Version: 2.6.5 Installed Applicati...

How to validate an xml file against an XSD Schema using Amara library in Python?

High bounty for the following Q: Hello, Here is what I tried on Ubuntu 9.10 using Python 2.6, Amara2 (by the way, test.xsd was created using xml2xsd tool): g@spot:~$ cat test.xml; echo =====o=====; cat test.xsd; echo ==== o=====; cat test.py; echo =====o=====; ./test.py; echo =====o===== <?xml version="1.0" encoding="utf-8"?>==; ....

Printing Attribute Values in python-amara

Hi, I'm trying to parse an xml file with using python-amara. doc = amara.parse('h.xml') assert doc.xml_type == tree.entity.xml_type m = doc.xml_children[0] print m When I do this it gives amara.tree.element at 0x94c864c: name u'HOP', 0 namespaces, 0 attributes, 93 children However when I try this : print doc.HOP.A.D it says...