From fredrik at pythonware.com Wed Jun 6 11:26:35 2007 From: fredrik at pythonware.com (Fredrik Lundh) Date: Wed, 06 Jun 2007 11:26:35 +0200 Subject: [XML-SIG] looking for conversion from dictionary In-Reply-To: <1504866.pVgtQIKpoQ@teancum> References: <1504866.pVgtQIKpoQ@teancum> Message-ID: David Bear wrote: > I google for 'convert python dictionary xml' but got way too many hits. > > Anyone have any pointers for a quick way to have a python dictionary > represented as xml? I want to have repr(pythondict) where > =keyname, and the contents of the tag is the value. your problem is a bit underspecified (to say the least), but assuming well-formed string keys and string values, here's one way to do it: >>> d = dict(foo="Foo!", bar="Bar!") >>> >>> import xml.etree.ElementTree as ET >>> e = ET.Element("dict") >>> for k in d: ... ET.SubElement(e, k).text = d[k] ... >>> ET.tostring(e) 'Foo!Bar!' if you want to support than just straightforward string/string mappings, you might want to look for XML serialization libraries instead. Python's standard xmlrpclib module can be used for this purpose: >>> import xmlrpclib >>> xmlrpclib.dumps((d,)) # dumps wants the data wrapped in a tuple '\n\n\n\nfoo\n Foo!\n\n\nbar\nBar !\n\n\n\n\n' see the library reference for details. hope this helps! From dkuhlman at rexx.com Thu Jun 7 22:34:02 2007 From: dkuhlman at rexx.com (Dave Kuhlman) Date: Thu, 7 Jun 2007 20:34:02 +0000 (UTC) Subject: [XML-SIG] Questions about lxml/ElementTree Message-ID: I'm using lxml and ElementTree. I like them. I do have a couple of questions: 1. When I get the tag for a node (element) using node.tag, I see something like this:: {http://xxxx.com/ns/yyyy}zzzz The stuff inside curly brackets is the namespace. I don't need that, so I use a regular expression to strip it off. My question is -- Is there a way to get the tag (element name) without a namespace. I'll feel silly at some time in the future after writing lots of code that strips the namespace if I find that there is an easier way. 2. When I use lxml, I call method node.getparent(). But, ElementTree elements do not support the getparent method. I'd like to suggest that it be added. How should I do that. Thanks for help. Dave From fredrik at pythonware.com Sat Jun 9 21:28:58 2007 From: fredrik at pythonware.com (Fredrik Lundh) Date: Sat, 09 Jun 2007 21:28:58 +0200 Subject: [XML-SIG] Questions about lxml/ElementTree In-Reply-To: References: Message-ID: Dave Kuhlman wrote: > 1. When I get the tag for a node (element) using node.tag, I see > something like this:: > > {http://xxxx.com/ns/yyyy}zzzz > > The stuff inside curly brackets is the namespace. I don't need > that, so I use a regular expression to strip it off. > > My question is -- Is there a way to get the tag (element name) > without a namespace. I'll feel silly at some time in the > future after writing lots of code that strips the namespace > if I find that there is an easier way. you'll probably feel even sillier when someone adds an element with the same tag but in a different namespace to the data you're dealing with, and your program breaks in a really strange way ;-) first, the namespace *is* part of the element name. you should only ignore it if you know exactly what you're doing. ("don't know what it's good for" isn't a valid reason ;-) if you decide that you want to ignore a specific namespace, be explicit. sometimes, you can define one or more safe-to-ignore namespaces in your program, and check for them. otherwise, you might have to inspect some container element, and get the actual namespace from there (the latter's sometimes necessary when dealing with some RSS dialects, for example). once you've figured out what you can safely ignore, you can clean up all the tags using something like: tagmap = {} for elem in tree.getiterator(): try: elem.tag = tagmap[elem.tag] except KeyError: ... figure out how to handle elem.tag ... elem.tag = tagmap[elem.tag] = new tag finally, using an RE to do the stripping feels a bit like overkill, though: I'm pretty sure tag.split("}")[-1] is more efficient (but I haven't benchmarked it in 2.5). hope this helps! cheers /F From dkuhlman at rexx.com Thu Jun 14 00:16:00 2007 From: dkuhlman at rexx.com (Dave Kuhlman) Date: Wed, 13 Jun 2007 22:16:00 +0000 (UTC) Subject: [XML-SIG] Questions about lxml/ElementTree References: Message-ID: Fredrik Lundh pythonware.com> writes: > > Dave Kuhlman wrote: > > > 1. When I get the tag for a node (element) using node.tag, I see > > something like this:: > > > > {http://xxxx.com/ns/yyyy}zzzz > > > > The stuff inside curly brackets is the namespace. I don't need > > that, so I use a regular expression to strip it off. > > > > My question is -- Is there a way to get the tag (element name) > > without a namespace. I'll feel silly at some time in the > > future after writing lots of code that strips the namespace > > if I find that there is an easier way. > > you'll probably feel even sillier when someone adds an element with the > same tag but in a different namespace to the data you're dealing with, > and your program breaks in a really strange way > > first, the namespace *is* part of the element name. you should only > ignore it if you know exactly what you're doing. ("don't know what it's > good for" isn't a valid reason > [snip] > hope this helps! Yes. That helps a lot. Thanks to you, I'm not ignoring namespaces, now. So, one more question -- If I want to check for a specific tag (for example, document) in the default namespace, I would use the following: if el.tag == '{%s}document' % el.nsmap[None]: Is that right? Is there some document that I can read that answers questions like this and that will tell me how to do namespace related tasks in a pythonic way? Thanks again for help. Dave From uche at ogbuji.net Sat Jun 23 19:33:12 2007 From: uche at ogbuji.net (Uche Ogbuji) Date: Sat, 23 Jun 2007 11:33:12 -0600 Subject: [XML-SIG] ANN: Amara XML Toolkit 1.2.0.2 Message-ID: <467D5958.7030704@ogbuji.net> http://uche.ogbuji.net/tech/4suite/amara http://cheeseshop.python.org/pypi/Amara/ ftp://ftp.4suite.org/pub/Amara/ Changes since Amara 1.2.0.1: * Fix bindery bug with e.g. del html.head.title * Fix bindery bug with elements named "None" * Fix bindery bug when a string object gets into a binding * Minor documentation and packaging tweaks Amara XML Toolkit is a collection of Python tools for XML processing-- not just tools that happen to be written in Python, but tools built from the ground up to use Python's conventions and take advantage of the many advantages of the language. Amara builds on 4Suite [http://4Suite.org], but whereas 4Suite offers more on literal implementation of XML standards in Python, Amara focuses on Pythonic idiom. It provides tools you can trust to conform with XML standards without losing the familiar Python feel. The components of Amara are: * Bindery: data binding tool (a very Pythonic XML API) * Scimitar: implementation of the ISO Schematron schema language for XML; converts Schematron files to Python scripts * domtools: set of tools to augment Python DOMs * saxtools: set of tools to make SAX easier to use in Python * Flextyper: user-defined datatypes in Python for XML processing There's a lot in Amara, but here are highlights: Amara Bindery: XML as easy as py -------------------------------- Bindery reads an XML document and it returns a data structure of Python objects corresponding to the vocabulary used in the XML document, for maximum clarity. Bindery turns the document What do you mean "bleh" But I was looking for argument Would become a set of objects so that you could write binding.monty.python.spam In order to get the value "eggs" (as a Python Unicode object) or binding.monty.python[1] In order to get the element object with the contents "But I was looking for argument". There are other such tools for Python, and what makes Bindery unique is that it's driven by a very declarative rules-based system for binding XML to the Python data. You can register rules that are triggered by XPattern expressions specialized binding behavior. It includes XPath support and is very efficient, using SAX to generate bindings. See the user documentation, manual.html, for more details. Scimitar: exceptional schema language for an exceptional programming language ----------------------------------------------------------------------------- Scimitar is an implementation of ISO Schematron that compiles a Schematron schema into a Python validator script. You typically use scimitar in two phases. Say you have a schematron schema schema1.stron and you want to validate multiple XML files against it, instance1.xml, instance2.xml, instance3.xml. First you run schema1.stron through the scimitar compiler script, scimitar.py: scimitar.py schema1.stron A file, schema1-stron.py, is generated in the current working directory. If you'd prefer a different location or file name, use the "-o" option. The generated file is a validator script in Python. It checks the schematron rules specified in schema1.stron. Run this validator on each XML file you wish to validate: python schema1.py instance1.xml The validation report is generated on standard output by default, or you can use the "-o" option to redirect it to a file. The validation report is an XML external parsed entity, a format much like a well-formed XML document, but with some restrictions relaxed. Amara DOM Tools: giving DOM a more Pythonic face ------------------------------------------------ Amara DOM Tools features pushdom, similar to xml.dom.pulldom, but easier to use, and a function to return an XPath location for any DOM node. Amara SAX Tools: SAX without the brain explosion ------------------------------------------------ Tenorsax (amara.saxtools.tenorsax) is a framework for "linerarizing" SAX logic so it flows a bit more naturally, needing much less state machine wizardry. License ------- Amara is open source, provided under the 4Suite variant of the Apache license. See the file COPYING for details. Installation ------------ Amara requires Python 2.4 or more recent and 4Suite-XML 1.0 or more recent. The easiest way to install it is: easy_install amara If this does not work you are probably not set up for easy_install and I suggest you follow the simple instructions at http://peak.telecommunity.com/DevCenter/EasyInstall easy_install will automatically take care of installing dependencies for you. If you prefer not to use easy_install, grab a 4Suite-XML package more recent than 1.0 and install that, then install the Amara package using the usual: python setup.py install Or a Windows installer, or other method. -- Uche Ogbuji http://uche.ogbuji.net Linked-in profile: http://www.linkedin.com/in/ucheogbuji Articles: http://uche.ogbuji.net/tech/publications/ From stefan_ml at behnel.de Sun Jun 24 13:12:50 2007 From: stefan_ml at behnel.de (Stefan Behnel) Date: Sun, 24 Jun 2007 13:12:50 +0200 Subject: [XML-SIG] lxml 1.3 released Message-ID: <467E51B2.4020207@behnel.de> Hi all, I'm proud to announce the release of lxml 1.3. http://codespeak.net/lxml/ http://cheeseshop.python.org/pypi/lxml/ ** What is lxml? """ In short: lxml is the most feature-rich and easy-to-use library for working with XML and HTML in the Python language. lxml is a Pythonic binding for the libxml2 and libxslt libraries. It is unique in that it combines the speed and feature completeness of these libraries with the simplicity of a native Python API. """ ** This is a major new release with various new features and lots of fixes compared to the 1.2 series. The complete changelog follows below. Major objectives of this release were: - API consolidation: make everything work with everything - improved namespace handling: avoid redundant namespaces wherever possible - simplicity and accessibility: improved, restructured documentation and simpler XML/HTML generation Future versions of lxml will continue this trend to make lxml the leading tool for XML and HTML in the Python world. Have fun, Stefan Behnel 1.3 (2007-06-24) ================ Features added -------------- * Module ``lxml.pyclasslookup`` implemens an Element class lookup scheme that can access the entire tree to determine a suitable Element class * Parsers take a ``remove_comments`` keyword argument that skips over comments * ``parse()`` function in ``objectify``, corresponding to ``XML()`` etc. * ``Element.addnext(el)`` and ``Element.addprevious(el)`` methods to support adding processing instructions and comments around the root node * Extended type annotation in objectify: cleaner annotation namespace setup plus new ``deannotate()`` function * Support for custom Element class instantiation in lxml.sax: passing a ``makeelement()`` function to the ElementTreeContentHandler will reuse the lookup context of that function * '.' represents empty ObjectPath (identity) Bugs fixed ---------- * Removing Elements from a tree could make them loose their namespace declarations * ``ElementInclude`` didn't honour base URL of original document * Replacing the children slice of an Element would cut off the tails of the original children * ``Element.getiterator(tag)`` did not accept ``Comment`` and ``ProcessingInstruction`` as tags * API functions now check incoming strings for XML conformity. Zero bytes or low ASCII characters are no longer accepted. * XSLT parsing failed to pass resolver context on to imported documents * More ET compatible behaviour when writing out XML declarations or not * ``Element.attrib`` was missing ``clear()`` and ``pop()`` methods * More robust error handling in ``iterparse()`` * Documents lost their top-level PIs and comments on serialisation * lxml.sax failed on comments and PIs. Comments are now properly ignored and PIs are copied. * Raise AssertionError when passing strings containing '\0' bytes 1.3beta (2007-02-27) ==================== Features added -------------- * ``DTD`` validator class (like ``RelaxNG`` and ``XMLSchema``) * HTML generator helpers by Fredrik Lundh in ``lxml.htmlbuilder`` * ``ElementMaker`` XML generator by Fredrik Lundh in ``lxml.builder.E`` * Support for pickeling ``objectify.ObjectifiedElement`` objects to XML * ``update()`` method on Element.attrib * Optimised replacement for libxml2's _xmlReconsiliateNs(). This allows lxml a better handling of namespaces when moving elements between documents. Bugs fixed ---------- * Possible memory leaks in namespace handling when moving elements between documents Other changes ------------- * major restructuring in the documentation From jza at openoffice.org Mon Jun 25 08:02:14 2007 From: jza at openoffice.org (Alexandro Colorado) Date: Mon, 25 Jun 2007 01:02:14 -0500 Subject: [XML-SIG] using minidom Message-ID: I am very confused about this mailing list, I joined yet I don't see many user-driven question which makes me think that maybe I am on the wrong list. Basically I know python to a very basic level, however I am triying to grasp some of the XML modules and manipulate XML on a faster way through a Python native libraries. So basically this is what I want, I want to progamatically be able to change the atribute of an XML: .... I want to change the toolbar:visible atribute from false to true preffering to use minidom. -- Alexandro Colorado OpenOffice.org Community Contact // Mexico http://www.openoffice.org Twitter: http://www.twitter.com/jza Jabber: jza at jabber.org From jza at openoffice.org Mon Jun 25 08:02:14 2007 From: jza at openoffice.org (Alexandro Colorado) Date: Mon, 25 Jun 2007 01:02:14 -0500 Subject: [XML-SIG] using minidom Message-ID: I am very confused about this mailing list, I joined yet I don't see many user-driven question which makes me think that maybe I am on the wrong list. Basically I know python to a very basic level, however I am triying to grasp some of the XML modules and manipulate XML on a faster way through a Python native libraries. So basically this is what I want, I want to progamatically be able to change the atribute of an XML: .... I want to change the toolbar:visible atribute from false to true preffering to use minidom. -- Alexandro Colorado OpenOffice.org Community Contact // Mexico http://www.openoffice.org Twitter: http://www.twitter.com/jza Jabber: jza at jabber.org From jza at openoffice.org Mon Jun 25 08:02:14 2007 From: jza at openoffice.org (Alexandro Colorado) Date: Mon, 25 Jun 2007 01:02:14 -0500 Subject: [XML-SIG] using minidom Message-ID: I am very confused about this mailing list, I joined yet I don't see many user-driven question which makes me think that maybe I am on the wrong list. Basically I know python to a very basic level, however I am triying to grasp some of the XML modules and manipulate XML on a faster way through a Python native libraries. So basically this is what I want, I want to progamatically be able to change the atribute of an XML: .... I want to change the toolbar:visible atribute from false to true preffering to use minidom. -- Alexandro Colorado OpenOffice.org Community Contact // Mexico http://www.openoffice.org Twitter: http://www.twitter.com/jza Jabber: jza at jabber.org From jza at openoffice.org Mon Jun 25 08:02:14 2007 From: jza at openoffice.org (Alexandro Colorado) Date: Mon, 25 Jun 2007 01:02:14 -0500 Subject: [XML-SIG] using minidom Message-ID: I am very confused about this mailing list, I joined yet I don't see many user-driven question which makes me think that maybe I am on the wrong list. Basically I know python to a very basic level, however I am triying to grasp some of the XML modules and manipulate XML on a faster way through a Python native libraries. So basically this is what I want, I want to progamatically be able to change the atribute of an XML: .... I want to change the toolbar:visible atribute from false to true preffering to use minidom. -- Alexandro Colorado OpenOffice.org Community Contact // Mexico http://www.openoffice.org Twitter: http://www.twitter.com/jza Jabber: jza at jabber.org From jza at openoffice.org Mon Jun 25 08:02:14 2007 From: jza at openoffice.org (Alexandro Colorado) Date: Mon, 25 Jun 2007 01:02:14 -0500 Subject: [XML-SIG] using minidom Message-ID: I am very confused about this mailing list, I joined yet I don't see many user-driven question which makes me think that maybe I am on the wrong list. Basically I know python to a very basic level, however I am triying to grasp some of the XML modules and manipulate XML on a faster way through a Python native libraries. So basically this is what I want, I want to progamatically be able to change the atribute of an XML: .... I want to change the toolbar:visible atribute from false to true preffering to use minidom. -- Alexandro Colorado OpenOffice.org Community Contact // Mexico http://www.openoffice.org Twitter: http://www.twitter.com/jza Jabber: jza at jabber.org From jza at openoffice.org Mon Jun 25 08:02:14 2007 From: jza at openoffice.org (Alexandro Colorado) Date: Mon, 25 Jun 2007 01:02:14 -0500 Subject: [XML-SIG] using minidom Message-ID: I am very confused about this mailing list, I joined yet I don't see many user-driven question which makes me think that maybe I am on the wrong list. Basically I know python to a very basic level, however I am triying to grasp some of the XML modules and manipulate XML on a faster way through a Python native libraries. So basically this is what I want, I want to progamatically be able to change the atribute of an XML: .... I want to change the toolbar:visible atribute from false to true preffering to use minidom. -- Alexandro Colorado OpenOffice.org Community Contact // Mexico http://www.openoffice.org Twitter: http://www.twitter.com/jza Jabber: jza at jabber.org From jza at openoffice.org Mon Jun 25 08:02:14 2007 From: jza at openoffice.org (Alexandro Colorado) Date: Mon, 25 Jun 2007 01:02:14 -0500 Subject: [XML-SIG] using minidom Message-ID: I am very confused about this mailing list, I joined yet I don't see many user-driven question which makes me think that maybe I am on the wrong list. Basically I know python to a very basic level, however I am triying to grasp some of the XML modules and manipulate XML on a faster way through a Python native libraries. So basically this is what I want, I want to progamatically be able to change the atribute of an XML: .... I want to change the toolbar:visible atribute from false to true preffering to use minidom. -- Alexandro Colorado OpenOffice.org Community Contact // Mexico http://www.openoffice.org Twitter: http://www.twitter.com/jza Jabber: jza at jabber.org From jza at openoffice.org Mon Jun 25 08:02:14 2007 From: jza at openoffice.org (Alexandro Colorado) Date: Mon, 25 Jun 2007 01:02:14 -0500 Subject: [XML-SIG] using minidom Message-ID: I am very confused about this mailing list, I joined yet I don't see many user-driven question which makes me think that maybe I am on the wrong list. Basically I know python to a very basic level, however I am triying to grasp some of the XML modules and manipulate XML on a faster way through a Python native libraries. So basically this is what I want, I want to progamatically be able to change the atribute of an XML: .... I want to change the toolbar:visible atribute from false to true preffering to use minidom. -- Alexandro Colorado OpenOffice.org Community Contact // Mexico http://www.openoffice.org Twitter: http://www.twitter.com/jza Jabber: jza at jabber.org From jza at openoffice.org Mon Jun 25 08:02:14 2007 From: jza at openoffice.org (Alexandro Colorado) Date: Mon, 25 Jun 2007 01:02:14 -0500 Subject: [XML-SIG] using minidom Message-ID: I am very confused about this mailing list, I joined yet I don't see many user-driven question which makes me think that maybe I am on the wrong list. Basically I know python to a very basic level, however I am triying to grasp some of the XML modules and manipulate XML on a faster way through a Python native libraries. So basically this is what I want, I want to progamatically be able to change the atribute of an XML: .... I want to change the toolbar:visible atribute from false to true preffering to use minidom. -- Alexandro Colorado OpenOffice.org Community Contact // Mexico http://www.openoffice.org Twitter: http://www.twitter.com/jza Jabber: jza at jabber.org From jza at openoffice.org Mon Jun 25 08:02:14 2007 From: jza at openoffice.org (Alexandro Colorado) Date: Mon, 25 Jun 2007 01:02:14 -0500 Subject: [XML-SIG] using minidom Message-ID: I am very confused about this mailing list, I joined yet I don't see many user-driven question which makes me think that maybe I am on the wrong list. Basically I know python to a very basic level, however I am triying to grasp some of the XML modules and manipulate XML on a faster way through a Python native libraries. So basically this is what I want, I want to progamatically be able to change the atribute of an XML: .... I want to change the toolbar:visible atribute from false to true preffering to use minidom. -- Alexandro Colorado OpenOffice.org Community Contact // Mexico http://www.openoffice.org Twitter: http://www.twitter.com/jza Jabber: jza at jabber.org From jza at openoffice.org Mon Jun 25 08:02:14 2007 From: jza at openoffice.org (Alexandro Colorado) Date: Mon, 25 Jun 2007 01:02:14 -0500 Subject: [XML-SIG] using minidom Message-ID: I am very confused about this mailing list, I joined yet I don't see many user-driven question which makes me think that maybe I am on the wrong list. Basically I know python to a very basic level, however I am triying to grasp some of the XML modules and manipulate XML on a faster way through a Python native libraries. So basically this is what I want, I want to progamatically be able to change the atribute of an XML: .... I want to change the toolbar:visible atribute from false to true preffering to use minidom. -- Alexandro Colorado OpenOffice.org Community Contact // Mexico http://www.openoffice.org Twitter: http://www.twitter.com/jza Jabber: jza at jabber.org From jza at openoffice.org Mon Jun 25 08:02:14 2007 From: jza at openoffice.org (Alexandro Colorado) Date: Mon, 25 Jun 2007 01:02:14 -0500 Subject: [XML-SIG] using minidom Message-ID: I am very confused about this mailing list, I joined yet I don't see many user-driven question which makes me think that maybe I am on the wrong list. Basically I know python to a very basic level, however I am triying to grasp some of the XML modules and manipulate XML on a faster way through a Python native libraries. So basically this is what I want, I want to progamatically be able to change the atribute of an XML: .... I want to change the toolbar:visible atribute from false to true preffering to use minidom. -- Alexandro Colorado OpenOffice.org Community Contact // Mexico http://www.openoffice.org Twitter: http://www.twitter.com/jza Jabber: jza at jabber.org From jza at openoffice.org Mon Jun 25 08:02:14 2007 From: jza at openoffice.org (Alexandro Colorado) Date: Mon, 25 Jun 2007 01:02:14 -0500 Subject: [XML-SIG] using minidom Message-ID: I am very confused about this mailing list, I joined yet I don't see many user-driven question which makes me think that maybe I am on the wrong list. Basically I know python to a very basic level, however I am triying to grasp some of the XML modules and manipulate XML on a faster way through a Python native libraries. So basically this is what I want, I want to progamatically be able to change the atribute of an XML: .... I want to change the toolbar:visible atribute from false to true preffering to use minidom. -- Alexandro Colorado OpenOffice.org Community Contact // Mexico http://www.openoffice.org Twitter: http://www.twitter.com/jza Jabber: jza at jabber.org From jza at openoffice.org Mon Jun 25 08:02:14 2007 From: jza at openoffice.org (Alexandro Colorado) Date: Mon, 25 Jun 2007 01:02:14 -0500 Subject: [XML-SIG] using minidom Message-ID: I am very confused about this mailing list, I joined yet I don't see many user-driven question which makes me think that maybe I am on the wrong list. Basically I know python to a very basic level, however I am triying to grasp some of the XML modules and manipulate XML on a faster way through a Python native libraries. So basically this is what I want, I want to progamatically be able to change the atribute of an XML: .... I want to change the toolbar:visible atribute from false to true preffering to use minidom. -- Alexandro Colorado OpenOffice.org Community Contact // Mexico http://www.openoffice.org Twitter: http://www.twitter.com/jza Jabber: jza at jabber.org From jza at openoffice.org Mon Jun 25 08:02:14 2007 From: jza at openoffice.org (Alexandro Colorado) Date: Mon, 25 Jun 2007 01:02:14 -0500 Subject: [XML-SIG] using minidom Message-ID: I am very confused about this mailing list, I joined yet I don't see many user-driven question which makes me think that maybe I am on the wrong list. Basically I know python to a very basic level, however I am triying to grasp some of the XML modules and manipulate XML on a faster way through a Python native libraries. So basically this is what I want, I want to progamatically be able to change the atribute of an XML: .... I want to change the toolbar:visible atribute from false to true preffering to use minidom. -- Alexandro Colorado OpenOffice.org Community Contact // Mexico http://www.openoffice.org Twitter: http://www.twitter.com/jza Jabber: jza at jabber.org From jza at openoffice.org Mon Jun 25 08:02:14 2007 From: jza at openoffice.org (Alexandro Colorado) Date: Mon, 25 Jun 2007 01:02:14 -0500 Subject: [XML-SIG] using minidom Message-ID: I am very confused about this mailing list, I joined yet I don't see many user-driven question which makes me think that maybe I am on the wrong list. Basically I know python to a very basic level, however I am triying to grasp some of the XML modules and manipulate XML on a faster way through a Python native libraries. So basically this is what I want, I want to progamatically be able to change the atribute of an XML: .... I want to change the toolbar:visible atribute from false to true preffering to use minidom. -- Alexandro Colorado OpenOffice.org Community Contact // Mexico http://www.openoffice.org Twitter: http://www.twitter.com/jza Jabber: jza at jabber.org From stefan_ml at behnel.de Mon Jun 25 14:15:14 2007 From: stefan_ml at behnel.de (Stefan Behnel) Date: Mon, 25 Jun 2007 14:15:14 +0200 Subject: [XML-SIG] using minidom In-Reply-To: References: Message-ID: <467FB1D2.4040107@behnel.de> Hi, Alexandro Colorado wrote: > So basically this is what I want, I want to progamatically be able to > change the atribute of an XML: > > > 1.0//EN" "toolbar.dtd"> > xmlns:xlink="http://www.w3.org/1999/xlink"> > > .... > > > I want to change the toolbar:visible atribute from false to true > preffering to use minidom. In case minidom is not a requirement, you can use lxml.etree: >>> import lxml.etree as et >>> finditems = et.XPath("//tb:toolbaritem[@tb:visible = 'false']", {'tb' : "http://openoffice.org/2001/toolbar"}) >>> tree = et.parse("myfile.xml") >>> for toolbaritem in finditems(tree): ... toolbaritem.set( ... "{http://openoffice.org/2001/toolbar}visible", "true") http://codespeak.net/lxml/ Stefan From stefan_ml at behnel.de Mon Jun 25 14:45:01 2007 From: stefan_ml at behnel.de (Stefan Behnel) Date: Mon, 25 Jun 2007 14:45:01 +0200 Subject: [XML-SIG] using minidom In-Reply-To: <467FB1D2.4040107@behnel.de> References: <467FB1D2.4040107@behnel.de> Message-ID: <467FB8CD.8020000@behnel.de> Hi, Stefan Behnel wrote: > Alexandro Colorado wrote: >> So basically this is what I want, I want to progamatically be able to >> change the atribute of an XML: >> >> >> > 1.0//EN" "toolbar.dtd"> >> > xmlns:xlink="http://www.w3.org/1999/xlink"> >> >> .... >> >> >> I want to change the toolbar:visible atribute from false to true >> preffering to use minidom. > > In case minidom is not a requirement, you can use lxml.etree: > > >>> import lxml.etree as et > >>> finditems = et.XPath("//tb:toolbaritem[@tb:visible = 'false']", > {'tb' : "http://openoffice.org/2001/toolbar"}) > >>> tree = et.parse("myfile.xml") > >>> for toolbaritem in finditems(tree): > ... toolbaritem.set( > ... "{http://openoffice.org/2001/toolbar}visible", "true") > > > http://codespeak.net/lxml/ Ah, BTW, if you need something that runs under an older Python version (I assume you want it to run in OOo), here's a solution that also runs with ElementTree (which can be installed on Python 1.5 and later). lxml requires at least Python 2.3. >>> import elementtree.ElementTree as et >>> TBNS = "{http://openoffice.org/2001/toolbar}" >>> tree = et.parse("myfile.xml") >>> for tbitem in tree.getiterator(TBNS+"toolbaritem"): ... if tbitem.get(TBNS+"visible") == "false": ... tbitem.set(TBNS+"visible", "true") Have fun, Stefan From jza at openoffice.org Mon Jun 25 15:26:32 2007 From: jza at openoffice.org (Alexandro Colorado) Date: Mon, 25 Jun 2007 08:26:32 -0500 Subject: [XML-SIG] using minidom In-Reply-To: <467FB1D2.4040107@behnel.de> References: <467FB1D2.4040107@behnel.de> Message-ID: On Mon, 25 Jun 2007 07:15:14 -0500, Stefan Behnel wrote: > Hi, > > Alexandro Colorado wrote: >> So basically this is what I want, I want to progamatically be able to >> change the atribute of an XML: >> >> >> > 1.0//EN" "toolbar.dtd"> >> > xmlns:xlink="http://www.w3.org/1999/xlink"> >> > toolbar:visible="false"/> >> .... >> >> >> I want to change the toolbar:visible atribute from false to true >> preffering to use minidom. > > In case minidom is not a requirement, you can use lxml.etree: only minidom/dom or sax > >>> import lxml.etree as et > >>> finditems = et.XPath("//tb:toolbaritem[@tb:visible = 'false']", > {'tb' : "http://openoffice.org/2001/toolbar"}) > >>> tree = et.parse("myfile.xml") > >>> for toolbaritem in finditems(tree): > ... toolbaritem.set( > ... "{http://openoffice.org/2001/toolbar}visible", "true") > > > http://codespeak.net/lxml/ > > Stefan -- Alexandro Colorado OpenOffice.org Community Contact // Mexico http://www.openoffice.org Twitter: http://www.twitter.com/jza Jabber: jza at jabber.org From jza at openoffice.org Mon Jun 25 15:27:00 2007 From: jza at openoffice.org (Alexandro Colorado) Date: Mon, 25 Jun 2007 08:27:00 -0500 Subject: [XML-SIG] using minidom In-Reply-To: <467FB8CD.8020000@behnel.de> References: <467FB1D2.4040107@behnel.de> <467FB8CD.8020000@behnel.de> Message-ID: >> In case minidom is not a requirement, you can use lxml.etree: >> >> >>> import lxml.etree as et >> >>> finditems = et.XPath("//tb:toolbaritem[@tb:visible = 'false']", >> {'tb' : "http://openoffice.org/2001/toolbar"}) >> >>> tree = et.parse("myfile.xml") >> >>> for toolbaritem in finditems(tree): >> ... toolbaritem.set( >> ... "{http://openoffice.org/2001/toolbar}visible", "true") >> >> >> http://codespeak.net/lxml/ > > Ah, BTW, if you need something that runs under an older Python version (I > assume you want it to run in OOo), here's a solution that also runs with > ElementTree (which can be installed on Python 1.5 and later). lxml > requires at > least Python 2.3. Unfortnately I dont have ET on my distribution of python and dont want to have dependencies to run my script. > >>> import elementtree.ElementTree as et > >>> TBNS = "{http://openoffice.org/2001/toolbar}" > >>> tree = et.parse("myfile.xml") > >>> for tbitem in tree.getiterator(TBNS+"toolbaritem"): > ... if tbitem.get(TBNS+"visible") == "false": > ... tbitem.set(TBNS+"visible", "true") > > > Have fun, > Stefan -- Alexandro Colorado OpenOffice.org Community Contact // Mexico http://www.openoffice.org Twitter: http://www.twitter.com/jza Jabber: jza at jabber.org From and-xml at doxdesk.com Tue Jun 26 04:52:10 2007 From: and-xml at doxdesk.com (Andrew Clover) Date: Tue, 26 Jun 2007 03:52:10 +0100 Subject: [XML-SIG] using minidom In-Reply-To: References: Message-ID: <46807F5A.9080702@doxdesk.com> Alexandro Colorado wrote: > I joined yet I don't see many user-driven question which makes me > think that maybe I am on the wrong list. Nope, you're fine - apart from the mailspew (if that's not at my end). This list is quiet of late as the PyXML project sees little development these days. minidom, for all its flaws, is a pretty stable target, and 4DOM use is in decline. > I want to change the toolbar:visible atribute from false to true > preffering to use minidom. That's pretty trivial: OONS= 'http://openoffice.org/2001/toolbar' doc= minidom.parse(PATH) item= doc.getElementsByTagNameNS(OONS, 'toolbaritem')[0] item.setAttributeNS(OONS, 'toolbar:visible', 'true') fp= open(PATH, 'wb') doc.writexml(fp) fp.close() minidom's documentation isn't that in-depth, but then it doesn't need to be, as most of the manipulation methods are standard ones documented by W3C DOM Level 2 Core. -- And Clover mailto:and at doxdesk.com http://www.doxdesk.com/ From debajit at debajit.com Tue Jun 26 19:54:37 2007 From: debajit at debajit.com (Debajit Adhikary) Date: Tue, 26 Jun 2007 13:54:37 -0400 Subject: [XML-SIG] Converting Diff Output to XML? In-Reply-To: <110a172d0706260743m10a9aaebt81e072717dbd6582@mail.gmail.com> References: <110a172d0706260743m10a9aaebt81e072717dbd6582@mail.gmail.com> Message-ID: <110a172d0706261054j47fa6f56w8eecec32ff62ce01@mail.gmail.com> What would be the best way to convert the regular (unix) diff output into XML? Are there any libraries at all which might help? -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/xml-sig/attachments/20070626/7ad42284/attachment.html From joonahy at gmail.com Thu Jun 28 21:03:15 2007 From: joonahy at gmail.com (joonah yoon) Date: Thu, 28 Jun 2007 15:03:15 -0400 Subject: [XML-SIG] installing PyXML-0.8.4 on Mac os x 10.4 Message-ID: I'm getting errors and couldn't install PyXML, which is needed to use some features on Inkscape. The following is what I typed in Terminal and messages I got. thanks, joonah dhcp-0000025677-ab-f7:~/desktop/PyXML-0.8.4 joonah$ export MACOSX_DEPLOYMENT_TARGET=10.4 dhcp-0000025677-ab-f7:~/desktop/PyXML-0.8.4 joonah$ python setup.py build running build running build_py creating build creating build/lib.macosx-10.4-fat-2.4 creating build/lib.macosx-10.4-fat-2.4/_xmlplus copying xml/__init__.py -> build/lib.macosx-10.4-fat-2.4/_xmlplus copying xml/FtCore.py -> build/lib.macosx-10.4-fat-2.4/_xmlplus copying xml/ns.py -> build/lib.macosx-10.4-fat-2.4/_xmlplus creating build/lib.macosx-10.4-fat-2.4/_xmlplus/dom copying xml/dom/__init__.py -> build/lib.macosx-10.4-fat-2.4/_xmlplus/dom copying xml/dom/Attr.py -> build/lib.macosx-10.4-fat-2.4/_xmlplus/dom copying xml/dom/CDATASection.py -> build/lib.macosx-10.4-fat-2.4/_xmlplus/dom copying xml/dom/CharacterData.py -> build/lib.macosx-10.4-fat-2.4/_xmlplus/dom copying xml/dom/Comment.py -> build/lib.macosx-10.4-fat-2.4/_xmlplus/dom copying xml/dom/Document.py -> build/lib.macosx-10.4-fat-2.4/_xmlplus/dom copying xml/dom/DocumentFragment.py -> build/lib.macosx-10.4-fat-2.4/_xmlplus/dom copying xml/dom/DocumentType.py -> build/lib.macosx-10.4-fat-2.4/_xmlplus/dom copying xml/dom/DOMImplementation.py -> build/lib.macosx-10.4-fat-2.4/_xmlplus/dom copying xml/dom/domreg.py -> build/lib.macosx-10.4-fat-2.4/_xmlplus/dom copying xml/dom/Element.py -> build/lib.macosx-10.4-fat-2.4/_xmlplus/dom copying xml/dom/Entity.py -> build/lib.macosx-10.4-fat-2.4/_xmlplus/dom copying xml/dom/EntityReference.py -> build/lib.macosx-10.4-fat-2.4/_xmlplus/dom copying xml/dom/Event.py -> build/lib.macosx-10.4-fat-2.4/_xmlplus/dom copying xml/dom/expatbuilder.py -> build/lib.macosx-10.4-fat-2.4/_xmlplus/dom copying xml/dom/FtNode.py -> build/lib.macosx-10.4-fat-2.4/_xmlplus/dom copying xml/dom/javadom.py -> build/lib.macosx-10.4-fat-2.4/_xmlplus/dom copying xml/dom/MessageSource.py -> build/lib.macosx-10.4-fat-2.4/_xmlplus/dom copying xml/dom/minicompat.py -> build/lib.macosx-10.4-fat-2.4/_xmlplus/dom copying xml/dom/minidom.py -> build/lib.macosx-10.4-fat-2.4/_xmlplus/dom copying xml/dom/minitraversal.py -> build/lib.macosx-10.4-fat-2.4/_xmlplus/dom copying xml/dom/NamedNodeMap.py -> build/lib.macosx-10.4-fat-2.4/_xmlplus/dom copying xml/dom/NodeFilter.py -> build/lib.macosx-10.4-fat-2.4/_xmlplus/dom copying xml/dom/NodeIterator.py -> build/lib.macosx-10.4-fat-2.4/_xmlplus/dom copying xml/dom/NodeList.py -> build/lib.macosx-10.4-fat-2.4/_xmlplus/dom copying xml/dom/Notation.py -> build/lib.macosx-10.4-fat-2.4/_xmlplus/dom copying xml/dom/ProcessingInstruction.py -> build/lib.macosx-10.4-fat-2.4/_xmlplus/dom copying xml/dom/pulldom.py -> build/lib.macosx-10.4-fat-2.4/_xmlplus/dom copying xml/dom/Range.py -> build/lib.macosx-10.4-fat-2.4/_xmlplus/dom copying xml/dom/Text.py -> build/lib.macosx-10.4-fat-2.4/_xmlplus/dom copying xml/dom/TreeWalker.py -> build/lib.macosx-10.4-fat-2.4/_xmlplus/dom copying xml/dom/xmlbuilder.py -> build/lib.macosx-10.4-fat-2.4/_xmlplus/dom creating build/lib.macosx-10.4-fat-2.4/_xmlplus/dom/html copying xml/dom/html/__init__.py -> build/lib.macosx-10.4-fat-2.4/_xmlplus/dom/html copying xml/dom/html/GenerateHtml.py -> build/lib.macosx-10.4-fat-2.4/_xmlplus/dom/html copying xml/dom/html/HTMLAnchorElement.py -> build/lib.macosx-10.4-fat-2.4/_xmlplus/dom/html copying xml/dom/html/HTMLAppletElement.py -> build/lib.macosx-10.4-fat-2.4/_xmlplus/dom/html copying xml/dom/html/HTMLAreaElement.py -> build/lib.macosx-10.4-fat-2.4/_xmlplus/dom/html copying xml/dom/html/HTMLBaseElement.py -> build/lib.macosx-10.4-fat-2.4/_xmlplus/dom/html copying xml/dom/html/HTMLBaseFontElement.py -> build/lib.macosx-10.4-fat-2.4/_xmlplus/dom/html copying xml/dom/html/HTMLBodyElement.py -> build/lib.macosx-10.4-fat-2.4/_xmlplus/dom/html copying xml/dom/html/HTMLBRElement.py -> build/lib.macosx-10.4-fat-2.4/_xmlplus/dom/html copying xml/dom/html/HTMLButtonElement.py -> build/lib.macosx-10.4-fat-2.4/_xmlplus/dom/html copying xml/dom/html/HTMLCollection.py -> build/lib.macosx-10.4-fat-2.4/_xmlplus/dom/html copying xml/dom/html/HTMLDirectoryElement.py -> build/lib.macosx-10.4-fat-2.4/_xmlplus/dom/html copying xml/dom/html/HTMLDivElement.py -> build/lib.macosx-10.4-fat-2.4/_xmlplus/dom/html copying xml/dom/html/HTMLDListElement.py -> build/lib.macosx-10.4-fat-2.4/_xmlplus/dom/html copying xml/dom/html/HTMLDocument.py -> build/lib.macosx-10.4-fat-2.4/_xmlplus/dom/html copying xml/dom/html/HTMLDOMImplementation.py -> build/lib.macosx-10.4-fat-2.4/_xmlplus/dom/html copying xml/dom/html/HTMLElement.py -> build/lib.macosx-10.4-fat-2.4/_xmlplus/dom/html copying xml/dom/html/HTMLFieldSetElement.py -> build/lib.macosx-10.4-fat-2.4/_xmlplus/dom/html copying xml/dom/html/HTMLFontElement.py -> build/lib.macosx-10.4-fat-2.4/_xmlplus/dom/html copying xml/dom/html/HTMLFormElement.py -> build/lib.macosx-10.4-fat-2.4/_xmlplus/dom/html copying xml/dom/html/HTMLFrameElement.py -> build/lib.macosx-10.4-fat-2.4/_xmlplus/dom/html copying xml/dom/html/HTMLFrameSetElement.py -> build/lib.macosx-10.4-fat-2.4/_xmlplus/dom/html copying xml/dom/html/HTMLHeadElement.py -> build/lib.macosx-10.4-fat-2.4/_xmlplus/dom/html copying xml/dom/html/HTMLHeadingElement.py -> build/lib.macosx-10.4-fat-2.4/_xmlplus/dom/html copying xml/dom/html/HTMLHRElement.py -> build/lib.macosx-10.4-fat-2.4/_xmlplus/dom/html copying xml/dom/html/HTMLHtmlElement.py -> build/lib.macosx-10.4-fat-2.4/_xmlplus/dom/html copying xml/dom/html/HTMLIFrameElement.py -> build/lib.macosx-10.4-fat-2.4/_xmlplus/dom/html copying xml/dom/html/HTMLImageElement.py -> build/lib.macosx-10.4-fat-2.4/_xmlplus/dom/html copying xml/dom/html/HTMLInputElement.py -> build/lib.macosx-10.4-fat-2.4/_xmlplus/dom/html copying xml/dom/html/HTMLIsIndexElement.py -> build/lib.macosx-10.4-fat-2.4/_xmlplus/dom/html copying xml/dom/html/HTMLLabelElement.py -> build/lib.macosx-10.4-fat-2.4/_xmlplus/dom/html copying xml/dom/html/HTMLLegendElement.py -> build/lib.macosx-10.4-fat-2.4/_xmlplus/dom/html copying xml/dom/html/HTMLLIElement.py -> build/lib.macosx-10.4-fat-2.4/_xmlplus/dom/html copying xml/dom/html/HTMLLinkElement.py -> build/lib.macosx-10.4-fat-2.4/_xmlplus/dom/html copying xml/dom/html/HTMLMapElement.py -> build/lib.macosx-10.4-fat-2.4/_xmlplus/dom/html copying xml/dom/html/HTMLMenuElement.py -> build/lib.macosx-10.4-fat-2.4/_xmlplus/dom/html copying xml/dom/html/HTMLMetaElement.py -> build/lib.macosx-10.4-fat-2.4/_xmlplus/dom/html copying xml/dom/html/HTMLModElement.py -> build/lib.macosx-10.4-fat-2.4/_xmlplus/dom/html copying xml/dom/html/HTMLObjectElement.py -> build/lib.macosx-10.4-fat-2.4/_xmlplus/dom/html copying xml/dom/html/HTMLOListElement.py -> build/lib.macosx-10.4-fat-2.4/_xmlplus/dom/html copying xml/dom/html/HTMLOptGroupElement.py -> build/lib.macosx-10.4-fat-2.4/_xmlplus/dom/html copying xml/dom/html/HTMLOptionElement.py -> build/lib.macosx-10.4-fat-2.4/_xmlplus/dom/html copying xml/dom/html/HTMLParagraphElement.py -> build/lib.macosx-10.4-fat-2.4/_xmlplus/dom/html copying xml/dom/html/HTMLParamElement.py -> build/lib.macosx-10.4-fat-2.4/_xmlplus/dom/html copying xml/dom/html/HTMLPreElement.py -> build/lib.macosx-10.4-fat-2.4/_xmlplus/dom/html copying xml/dom/html/HTMLQuoteElement.py -> build/lib.macosx-10.4-fat-2.4/_xmlplus/dom/html copying xml/dom/html/HTMLScriptElement.py -> build/lib.macosx-10.4-fat-2.4/_xmlplus/dom/html copying xml/dom/html/HTMLSelectElement.py -> build/lib.macosx-10.4-fat-2.4/_xmlplus/dom/html copying xml/dom/html/HTMLStyleElement.py -> build/lib.macosx-10.4-fat-2.4/_xmlplus/dom/html copying xml/dom/html/HTMLTableCaptionElement.py -> build/lib.macosx-10.4-fat-2.4/_xmlplus/dom/html copying xml/dom/html/HTMLTableCellElement.py -> build/lib.macosx-10.4-fat-2.4/_xmlplus/dom/html copying xml/dom/html/HTMLTableColElement.py -> build/lib.macosx-10.4-fat-2.4/_xmlplus/dom/html copying xml/dom/html/HTMLTableElement.py -> build/lib.macosx-10.4-fat-2.4/_xmlplus/dom/html copying xml/dom/html/HTMLTableRowElement.py -> build/lib.macosx-10.4-fat-2.4/_xmlplus/dom/html copying xml/dom/html/HTMLTableSectionElement.py -> build/lib.macosx-10.4-fat-2.4/_xmlplus/dom/html copying xml/dom/html/HTMLTextAreaElement.py -> build/lib.macosx-10.4-fat-2.4/_xmlplus/dom/html copying xml/dom/html/HTMLTitleElement.py -> build/lib.macosx-10.4-fat-2.4/_xmlplus/dom/html copying xml/dom/html/HTMLUListElement.py -> build/lib.macosx-10.4-fat-2.4/_xmlplus/dom/html creating build/lib.macosx-10.4-fat-2.4/_xmlplus/dom/ext copying xml/dom/ext/__init__.py -> build/lib.macosx-10.4-fat-2.4/_xmlplus/dom/ext copying xml/dom/ext/c14n.py -> build/lib.macosx-10.4-fat-2.4/_xmlplus/dom/ext copying xml/dom/ext/Dom2Sax.py -> build/lib.macosx-10.4-fat-2.4/_xmlplus/dom/ext copying xml/dom/ext/Printer.py -> build/lib.macosx-10.4-fat-2.4/_xmlplus/dom/ext copying xml/dom/ext/Visitor.py -> build/lib.macosx-10.4-fat-2.4/_xmlplus/dom/ext copying xml/dom/ext/XHtml2HtmlPrinter.py -> build/lib.macosx-10.4-fat-2.4/_xmlplus/dom/ext copying xml/dom/ext/XHtmlPrinter.py -> build/lib.macosx-10.4-fat-2.4/_xmlplus/dom/ext creating build/lib.macosx-10.4-fat-2.4/_xmlplus/dom/ext/reader copying xml/dom/ext/reader/__init__.py -> build/lib.macosx-10.4-fat-2.4/_xmlplus/dom/ext/reader copying xml/dom/ext/reader/HtmlLib.py -> build/lib.macosx-10.4-fat-2.4/_xmlplus/dom/ext/reader copying xml/dom/ext/reader/HtmlSax.py -> build/lib.macosx-10.4-fat-2.4/_xmlplus/dom/ext/reader copying xml/dom/ext/reader/PyExpat.py -> build/lib.macosx-10.4-fat-2.4/_xmlplus/dom/ext/reader copying xml/dom/ext/reader/Sax.py -> build/lib.macosx-10.4-fat-2.4/_xmlplus/dom/ext/reader copying xml/dom/ext/reader/Sax2.py -> build/lib.macosx-10.4-fat-2.4/_xmlplus/dom/ext/reader copying xml/dom/ext/reader/Sax2Lib.py -> build/lib.macosx-10.4-fat-2.4/_xmlplus/dom/ext/reader copying xml/dom/ext/reader/Sgmlop.py -> build/lib.macosx-10.4-fat-2.4/_xmlplus/dom/ext/reader creating build/lib.macosx-10.4-fat-2.4/_xmlplus/marshal copying xml/marshal/__init__.py -> build/lib.macosx-10.4-fat-2.4/_xmlplus/marshal copying xml/marshal/generic.py -> build/lib.macosx-10.4-fat-2.4/_xmlplus/marshal copying xml/marshal/wddx.py -> build/lib.macosx-10.4-fat-2.4/_xmlplus/marshal creating build/lib.macosx-10.4-fat-2.4/_xmlplus/unicode copying xml/unicode/__init__.py -> build/lib.macosx-10.4-fat-2.4/_xmlplus/unicode copying xml/unicode/iso8859.py -> build/lib.macosx-10.4-fat-2.4/_xmlplus/unicode copying xml/unicode/utf8_iso.py -> build/lib.macosx-10.4-fat-2.4/_xmlplus/unicode creating build/lib.macosx-10.4-fat-2.4/_xmlplus/parsers copying xml/parsers/__init__.py -> build/lib.macosx-10.4-fat-2.4/_xmlplus/parsers copying xml/parsers/expat.py -> build/lib.macosx-10.4-fat-2.4/_xmlplus/parsers copying xml/parsers/sgmllib.py -> build/lib.macosx-10.4-fat-2.4/_xmlplus/parsers creating build/lib.macosx-10.4-fat-2.4/_xmlplus/parsers/xmlproc copying xml/parsers/xmlproc/__init__.py -> build/lib.macosx-10.4-fat-2.4/_xmlplus/parsers/xmlproc copying xml/parsers/xmlproc/_outputters.py -> build/lib.macosx-10.4-fat-2.4/_xmlplus/parsers/xmlproc copying xml/parsers/xmlproc/catalog.py -> build/lib.macosx-10.4-fat-2.4/_xmlplus/parsers/xmlproc copying xml/parsers/xmlproc/charconv.py -> build/lib.macosx-10.4-fat-2.4/_xmlplus/parsers/xmlproc copying xml/parsers/xmlproc/dtdparser.py -> build/lib.macosx-10.4-fat-2.4/_xmlplus/parsers/xmlproc copying xml/parsers/xmlproc/errors.py -> build/lib.macosx-10.4-fat-2.4/_xmlplus/parsers/xmlproc copying xml/parsers/xmlproc/namespace.py -> build/lib.macosx-10.4-fat-2.4/_xmlplus/parsers/xmlproc copying xml/parsers/xmlproc/utils.py -> build/lib.macosx-10.4-fat-2.4/_xmlplus/parsers/xmlproc copying xml/parsers/xmlproc/xcatalog.py -> build/lib.macosx-10.4-fat-2.4/_xmlplus/parsers/xmlproc copying xml/parsers/xmlproc/xmlapp.py -> build/lib.macosx-10.4-fat-2.4/_xmlplus/parsers/xmlproc copying xml/parsers/xmlproc/xmldtd.py -> build/lib.macosx-10.4-fat-2.4/_xmlplus/parsers/xmlproc copying xml/parsers/xmlproc/xmlproc.py -> build/lib.macosx-10.4-fat-2.4/_xmlplus/parsers/xmlproc copying xml/parsers/xmlproc/xmlutils.py -> build/lib.macosx-10.4-fat-2.4/_xmlplus/parsers/xmlproc copying xml/parsers/xmlproc/xmlval.py -> build/lib.macosx-10.4-fat-2.4/_xmlplus/parsers/xmlproc creating build/lib.macosx-10.4-fat-2.4/_xmlplus/sax copying xml/sax/__init__.py -> build/lib.macosx-10.4-fat-2.4/_xmlplus/sax copying xml/sax/_exceptions.py -> build/lib.macosx-10.4-fat-2.4/_xmlplus/sax copying xml/sax/expatreader.py -> build/lib.macosx-10.4-fat-2.4/_xmlplus/sax copying xml/sax/handler.py -> build/lib.macosx-10.4-fat-2.4/_xmlplus/sax copying xml/sax/sax2exts.py -> build/lib.macosx-10.4-fat-2.4/_xmlplus/sax copying xml/sax/saxexts.py -> build/lib.macosx-10.4-fat-2.4/_xmlplus/sax copying xml/sax/saxlib.py -> build/lib.macosx-10.4-fat-2.4/_xmlplus/sax copying xml/sax/saxutils.py -> build/lib.macosx-10.4-fat-2.4/_xmlplus/sax copying xml/sax/writer.py -> build/lib.macosx-10.4-fat-2.4/_xmlplus/sax copying xml/sax/xmlreader.py -> build/lib.macosx-10.4-fat-2.4/_xmlplus/sax creating build/lib.macosx-10.4-fat-2.4/_xmlplus/sax/drivers copying xml/sax/drivers/__init__.py -> build/lib.macosx-10.4-fat-2.4/_xmlplus/sax/drivers copying xml/sax/drivers/drv_htmllib.py -> build/lib.macosx-10.4-fat-2.4/_xmlplus/sax/drivers copying xml/sax/drivers/drv_ltdriver.py -> build/lib.macosx-10.4-fat-2.4/_xmlplus/sax/drivers copying xml/sax/drivers/drv_ltdriver_val.py -> build/lib.macosx-10.4-fat-2.4/_xmlplus/sax/drivers copying xml/sax/drivers/drv_pyexpat.py -> build/lib.macosx-10.4-fat-2.4/_xmlplus/sax/drivers copying xml/sax/drivers/drv_sgmllib.py -> build/lib.macosx-10.4-fat-2.4/_xmlplus/sax/drivers copying xml/sax/drivers/drv_sgmlop.py -> build/lib.macosx-10.4-fat-2.4/_xmlplus/sax/drivers copying xml/sax/drivers/drv_xmldc.py -> build/lib.macosx-10.4-fat-2.4/_xmlplus/sax/drivers copying xml/sax/drivers/drv_xmllib.py -> build/lib.macosx-10.4-fat-2.4/_xmlplus/sax/drivers copying xml/sax/drivers/drv_xmlproc.py -> build/lib.macosx-10.4-fat-2.4/_xmlplus/sax/drivers copying xml/sax/drivers/drv_xmlproc_val.py -> build/lib.macosx-10.4-fat-2.4/_xmlplus/sax/drivers copying xml/sax/drivers/drv_xmltoolkit.py -> build/lib.macosx-10.4-fat-2.4/_xmlplus/sax/drivers copying xml/sax/drivers/pylibs.py -> build/lib.macosx-10.4-fat-2.4/_xmlplus/sax/drivers creating build/lib.macosx-10.4-fat-2.4/_xmlplus/sax/drivers2 copying xml/sax/drivers2/__init__.py -> build/lib.macosx-10.4-fat-2.4/_xmlplus/sax/drivers2 copying xml/sax/drivers2/drv_htmllib.py -> build/lib.macosx-10.4-fat-2.4/_xmlplus/sax/drivers2 copying xml/sax/drivers2/drv_javasax.py -> build/lib.macosx-10.4-fat-2.4/_xmlplus/sax/drivers2 copying xml/sax/drivers2/drv_pyexpat.py -> build/lib.macosx-10.4-fat-2.4/_xmlplus/sax/drivers2 copying xml/sax/drivers2/drv_sgmllib.py -> build/lib.macosx-10.4-fat-2.4/_xmlplus/sax/drivers2 copying xml/sax/drivers2/drv_sgmlop.py -> build/lib.macosx-10.4-fat-2.4/_xmlplus/sax/drivers2 copying xml/sax/drivers2/drv_sgmlop_html.py -> build/lib.macosx-10.4-fat-2.4/_xmlplus/sax/drivers2 copying xml/sax/drivers2/drv_xmlproc.py -> build/lib.macosx-10.4-fat-2.4/_xmlplus/sax/drivers2 creating build/lib.macosx-10.4-fat-2.4/_xmlplus/utils copying xml/utils/__init__.py -> build/lib.macosx-10.4-fat-2.4/_xmlplus/utils copying xml/utils/characters.py -> build/lib.macosx-10.4-fat-2.4/_xmlplus/utils copying xml/utils/iso8601.py -> build/lib.macosx-10.4-fat-2.4/_xmlplus/utils copying xml/utils/qp_xml.py -> build/lib.macosx-10.4-fat-2.4/_xmlplus/utils creating build/lib.macosx-10.4-fat-2.4/_xmlplus/schema copying xml/schema/__init__.py -> build/lib.macosx-10.4-fat-2.4/_xmlplus/schema copying xml/schema/trex.py -> build/lib.macosx-10.4-fat-2.4/_xmlplus/schema creating build/lib.macosx-10.4-fat-2.4/_xmlplus/xpath copying xml/xpath/__init__.py -> build/lib.macosx-10.4-fat-2.4/_xmlplus/xpath copying xml/xpath/BuiltInExtFunctions.py -> build/lib.macosx-10.4-fat-2.4/_xmlplus/xpath copying xml/xpath/Context.py -> build/lib.macosx-10.4-fat-2.4/_xmlplus/xpath copying xml/xpath/Conversions.py -> build/lib.macosx-10.4-fat-2.4/_xmlplus/xpath copying xml/xpath/CoreFunctions.py -> build/lib.macosx-10.4-fat-2.4/_xmlplus/xpath copying xml/xpath/ExpandedNameWrapper.py -> build/lib.macosx-10.4-fat-2.4/_xmlplus/xpath copying xml/xpath/MessageSource.py -> build/lib.macosx-10.4-fat-2.4/_xmlplus/xpath copying xml/xpath/NamespaceNode.py -> build/lib.macosx-10.4-fat-2.4/_xmlplus/xpath copying xml/xpath/ParsedAbbreviatedAbsoluteLocationPath.py -> build/lib.macosx-10.4-fat-2.4/_xmlplus/xpath copying xml/xpath/ParsedAbbreviatedRelativeLocationPath.py -> build/lib.macosx-10.4-fat-2.4/_xmlplus/xpath copying xml/xpath/ParsedAbsoluteLocationPath.py -> build/lib.macosx-10.4-fat-2.4/_xmlplus/xpath copying xml/xpath/ParsedAxisSpecifier.py -> build/lib.macosx-10.4-fat-2.4/_xmlplus/xpath copying xml/xpath/ParsedExpr.py -> build/lib.macosx-10.4-fat-2.4/_xmlplus/xpath copying xml/xpath/ParsedNodeTest.py -> build/lib.macosx-10.4-fat-2.4/_xmlplus/xpath copying xml/xpath/ParsedPredicateList.py -> build/lib.macosx-10.4-fat-2.4/_xmlplus/xpath copying xml/xpath/ParsedRelativeLocationPath.py -> build/lib.macosx-10.4-fat-2.4/_xmlplus/xpath copying xml/xpath/ParsedStep.py -> build/lib.macosx-10.4-fat-2.4/_xmlplus/xpath copying xml/xpath/pyxpath.py -> build/lib.macosx-10.4-fat-2.4/_xmlplus/xpath copying xml/xpath/Set.py -> build/lib.macosx-10.4-fat-2.4/_xmlplus/xpath copying xml/xpath/Util.py -> build/lib.macosx-10.4-fat-2.4/_xmlplus/xpath copying xml/xpath/XPathGrammar.py -> build/lib.macosx-10.4-fat-2.4/_xmlplus/xpath copying xml/xpath/XPathParser.py -> build/lib.macosx-10.4-fat-2.4/_xmlplus/xpath copying xml/xpath/XPathParserBase.py -> build/lib.macosx-10.4-fat-2.4/_xmlplus/xpath copying xml/xpath/yappsrt.py -> build/lib.macosx-10.4-fat-2.4/_xmlplus/xpath running build_ext building '_xmlplus.parsers.pyexpat' extension creating build/temp.macosx-10.4-fat-2.4 creating build/temp.macosx-10.4-fat-2.4/extensions creating build/temp.macosx-10.4-fat-2.4/extensions/expat creating build/temp.macosx-10.4-fat-2.4/extensions/expat/lib gcc -arch ppc -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -fno-strict-aliasing -Wno-long-double -no-cpp-precomp -mno-fused-madd -fno-common -dynamic -DNDEBUG -g -DXML_NS=1 -DXML_DTD=1 -DBYTEORDER=1234 -DXML_CONTEXT_BYTES=1024 -DHAVE_MEMMOVE=1 -Iextensions/expat/lib -I/Library/Frameworks/Python.framework/Versions/2.4/include/python2.4 -c extensions/pyexpat.c -o build/temp.macosx-10.4-fat-2.4/extensions/pyexpat.o unable to execute gcc: No such file or directory error: command 'gcc' failed with exit status 1 dhcp-0000025677-ab-f7:~/desktop/PyXML-0.8.4 joonah$ sudo python setup.py installPassword: running install running build running build_py running build_ext building '_xmlplus.parsers.pyexpat' extension gcc -arch ppc -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -fno-strict-aliasing -Wno-long-double -no-cpp-precomp -mno-fused-madd -fno-common -dynamic -DNDEBUG -g -DXML_NS=1 -DXML_DTD=1 -DBYTEORDER=1234 -DXML_CONTEXT_BYTES=1024 -DHAVE_MEMMOVE=1 -Iextensions/expat/lib -I/Library/Frameworks/Python.framework/Versions/2.4/include/python2.4 -c extensions/pyexpat.c -o build/temp.macosx-10.4-fat-2.4/extensions/pyexpat.o unable to execute gcc: No such file or directory error: command 'gcc' failed with exit status 1 From mike at skew.org Fri Jun 29 11:46:43 2007 From: mike at skew.org (Mike Brown) Date: Fri, 29 Jun 2007 03:46:43 -0600 (MDT) Subject: [XML-SIG] installing PyXML-0.8.4 on Mac os x 10.4 In-Reply-To: Message-ID: <200706290946.l5T9khv1019195@chilled.skew.org> joonah yoon wrote: > unable to execute gcc: No such file or directory It seems you don't have the C compiler gcc installed. Most Unix OSes have it, but OS X doesn't by default. gcc can be obtained in Apple's Xcode IDE, though, which should be on your installation disk or available via http://developer.apple.com/tools/xcode/ I'm not an OS X user; I just used Google...