From benn at cenix-bioscience.com Tue Jan 3 14:56:33 2006 From: benn at cenix-bioscience.com (Neil Benn) Date: Tue, 03 Jan 2006 14:56:33 +0100 Subject: [XML-SIG] ElementTree and ContentHandler Message-ID: <43BA8291.3070806@cenix-bioscience.com> Hello, I have a generated parsing system which parses data which is not XML and then generates SAX events for the parsed data. The system can then have a contenthandler bound to it which will capture the events and can them output it in a variety of formats (raw XML to a file, DOM, collections, custom ValueObject, etc). If you need an example of it then one published case of this (sorry it's in Java) is at : http://www.biojava.org/tutorials/blastlikeParsingCookBook/index.html. Anyways, that lays out my use case, one of the extra output formats I would like to use is to output is an ElementTree object, however from what I can see I can't see that there is a class that implements the ContentHandler interface and spits out an ElementTree in the downloaded package. I can do this myself (and contribute it back to the project if it is wanted) but I wanted to first check that it doesn;t already exist before doing the work. I know I could output the structure as XML into a 'file-like object' but that would slow the parsing down which would be noticable on large data sets (although you shouldn't be using ElementTree on large data sets anyways ;-) ). Thanks for your help. Cheers, Neil -- Neil Benn Senior Automation Engineer Cenix BioScience BioInnovations Zentrum Tatzberg 46 D-01307 Dresden Germany Tel : +49 (0)351 4173 154 e-mail : benn at cenix-bioscience.com Cenix Website : http://www.cenix-bioscience.com From PyXML at fcl.demon.nl Thu Jan 5 14:38:21 2006 From: PyXML at fcl.demon.nl (PyXML at fcl.demon.nl) Date: Thu, 05 Jan 2006 14:38:21 +0100 Subject: [XML-SIG] trouble installing PyXML package Message-ID: <20060105143821.x1ebmd546ccw0c44@www.webmail.nl.demon.net> Hi there, I'm having trouble installing the PyXML Package 0.8.4 (which is actually 0.8.3 according to the README contents). The readme states to contact here in case of difficulties installing the software. I'll try to describe the problem underneath. After unpacking the files to a temp directory I try to build, typing: python setup.py build The output of this command can be found in build_output.txt, it seems to break when trying to run build_ext. Trying "sudo python setup.py install" gives me the same results. I have no idea what can be the problem but I suspect the setup script expected me to provide a parameter? Some information on my system: I'm running Ubuntu (breezy) with all necessary dev-packages installed (already ran into Python package problems before some time ago). Many thanks in advance for helping out. Cheers, Frans -------------- next part -------------- running build running build_py creating build creating build/lib.linux-i686-2.4 creating build/lib.linux-i686-2.4/_xmlplus copying xml/FtCore.py -> build/lib.linux-i686-2.4/_xmlplus copying xml/__init__.py -> build/lib.linux-i686-2.4/_xmlplus copying xml/ns.py -> build/lib.linux-i686-2.4/_xmlplus creating build/lib.linux-i686-2.4/_xmlplus/dom copying xml/dom/Attr.py -> build/lib.linux-i686-2.4/_xmlplus/dom copying xml/dom/CDATASection.py -> build/lib.linux-i686-2.4/_xmlplus/dom copying xml/dom/CharacterData.py -> build/lib.linux-i686-2.4/_xmlplus/dom copying xml/dom/Comment.py -> build/lib.linux-i686-2.4/_xmlplus/dom copying xml/dom/DOMImplementation.py -> build/lib.linux-i686-2.4/_xmlplus/dom copying xml/dom/Document.py -> build/lib.linux-i686-2.4/_xmlplus/dom copying xml/dom/DocumentFragment.py -> build/lib.linux-i686-2.4/_xmlplus/dom copying xml/dom/DocumentType.py -> build/lib.linux-i686-2.4/_xmlplus/dom copying xml/dom/Element.py -> build/lib.linux-i686-2.4/_xmlplus/dom copying xml/dom/Entity.py -> build/lib.linux-i686-2.4/_xmlplus/dom copying xml/dom/EntityReference.py -> build/lib.linux-i686-2.4/_xmlplus/dom copying xml/dom/Event.py -> build/lib.linux-i686-2.4/_xmlplus/dom copying xml/dom/FtNode.py -> build/lib.linux-i686-2.4/_xmlplus/dom copying xml/dom/MessageSource.py -> build/lib.linux-i686-2.4/_xmlplus/dom copying xml/dom/NamedNodeMap.py -> build/lib.linux-i686-2.4/_xmlplus/dom copying xml/dom/NodeFilter.py -> build/lib.linux-i686-2.4/_xmlplus/dom copying xml/dom/NodeIterator.py -> build/lib.linux-i686-2.4/_xmlplus/dom copying xml/dom/NodeList.py -> build/lib.linux-i686-2.4/_xmlplus/dom copying xml/dom/Notation.py -> build/lib.linux-i686-2.4/_xmlplus/dom copying xml/dom/ProcessingInstruction.py -> build/lib.linux-i686-2.4/_xmlplus/dom copying xml/dom/Range.py -> build/lib.linux-i686-2.4/_xmlplus/dom copying xml/dom/Text.py -> build/lib.linux-i686-2.4/_xmlplus/dom copying xml/dom/TreeWalker.py -> build/lib.linux-i686-2.4/_xmlplus/dom copying xml/dom/__init__.py -> build/lib.linux-i686-2.4/_xmlplus/dom copying xml/dom/domreg.py -> build/lib.linux-i686-2.4/_xmlplus/dom copying xml/dom/expatbuilder.py -> build/lib.linux-i686-2.4/_xmlplus/dom copying xml/dom/javadom.py -> build/lib.linux-i686-2.4/_xmlplus/dom copying xml/dom/minicompat.py -> build/lib.linux-i686-2.4/_xmlplus/dom copying xml/dom/minidom.py -> build/lib.linux-i686-2.4/_xmlplus/dom copying xml/dom/minitraversal.py -> build/lib.linux-i686-2.4/_xmlplus/dom copying xml/dom/pulldom.py -> build/lib.linux-i686-2.4/_xmlplus/dom copying xml/dom/xmlbuilder.py -> build/lib.linux-i686-2.4/_xmlplus/dom creating build/lib.linux-i686-2.4/_xmlplus/dom/html copying xml/dom/html/GenerateHtml.py -> build/lib.linux-i686-2.4/_xmlplus/dom/html copying xml/dom/html/HTMLAnchorElement.py -> build/lib.linux-i686-2.4/_xmlplus/dom/html copying xml/dom/html/HTMLAppletElement.py -> build/lib.linux-i686-2.4/_xmlplus/dom/html copying xml/dom/html/HTMLAreaElement.py -> build/lib.linux-i686-2.4/_xmlplus/dom/html copying xml/dom/html/HTMLBRElement.py -> build/lib.linux-i686-2.4/_xmlplus/dom/html copying xml/dom/html/HTMLBaseElement.py -> build/lib.linux-i686-2.4/_xmlplus/dom/html copying xml/dom/html/HTMLBaseFontElement.py -> build/lib.linux-i686-2.4/_xmlplus/dom/html copying xml/dom/html/HTMLBodyElement.py -> build/lib.linux-i686-2.4/_xmlplus/dom/html copying xml/dom/html/HTMLButtonElement.py -> build/lib.linux-i686-2.4/_xmlplus/dom/html copying xml/dom/html/HTMLCollection.py -> build/lib.linux-i686-2.4/_xmlplus/dom/html copying xml/dom/html/HTMLDListElement.py -> build/lib.linux-i686-2.4/_xmlplus/dom/html copying xml/dom/html/HTMLDOMImplementation.py -> build/lib.linux-i686-2.4/_xmlplus/dom/html copying xml/dom/html/HTMLDirectoryElement.py -> build/lib.linux-i686-2.4/_xmlplus/dom/html copying xml/dom/html/HTMLDivElement.py -> build/lib.linux-i686-2.4/_xmlplus/dom/html copying xml/dom/html/HTMLDocument.py -> build/lib.linux-i686-2.4/_xmlplus/dom/html copying xml/dom/html/HTMLElement.py -> build/lib.linux-i686-2.4/_xmlplus/dom/html copying xml/dom/html/__init__.py -> build/lib.linux-i686-2.4/_xmlplus/dom/html copying xml/dom/html/HTMLFieldSetElement.py -> build/lib.linux-i686-2.4/_xmlplus/dom/html copying xml/dom/html/HTMLFontElement.py -> build/lib.linux-i686-2.4/_xmlplus/dom/html copying xml/dom/html/HTMLFormElement.py -> build/lib.linux-i686-2.4/_xmlplus/dom/html copying xml/dom/html/HTMLFrameElement.py -> build/lib.linux-i686-2.4/_xmlplus/dom/html copying xml/dom/html/HTMLFrameSetElement.py -> build/lib.linux-i686-2.4/_xmlplus/dom/html copying xml/dom/html/HTMLHRElement.py -> build/lib.linux-i686-2.4/_xmlplus/dom/html copying xml/dom/html/HTMLHeadElement.py -> build/lib.linux-i686-2.4/_xmlplus/dom/html copying xml/dom/html/HTMLHeadingElement.py -> build/lib.linux-i686-2.4/_xmlplus/dom/html copying xml/dom/html/HTMLHtmlElement.py -> build/lib.linux-i686-2.4/_xmlplus/dom/html copying xml/dom/html/HTMLIFrameElement.py -> build/lib.linux-i686-2.4/_xmlplus/dom/html copying xml/dom/html/HTMLImageElement.py -> build/lib.linux-i686-2.4/_xmlplus/dom/html copying xml/dom/html/HTMLInputElement.py -> build/lib.linux-i686-2.4/_xmlplus/dom/html copying xml/dom/html/HTMLIsIndexElement.py -> build/lib.linux-i686-2.4/_xmlplus/dom/html copying xml/dom/html/HTMLLIElement.py -> build/lib.linux-i686-2.4/_xmlplus/dom/html copying xml/dom/html/HTMLLabelElement.py -> build/lib.linux-i686-2.4/_xmlplus/dom/html copying xml/dom/html/HTMLLegendElement.py -> build/lib.linux-i686-2.4/_xmlplus/dom/html copying xml/dom/html/HTMLLinkElement.py -> build/lib.linux-i686-2.4/_xmlplus/dom/html copying xml/dom/html/HTMLMapElement.py -> build/lib.linux-i686-2.4/_xmlplus/dom/html copying xml/dom/html/HTMLMenuElement.py -> build/lib.linux-i686-2.4/_xmlplus/dom/html copying xml/dom/html/HTMLMetaElement.py -> build/lib.linux-i686-2.4/_xmlplus/dom/html copying xml/dom/html/HTMLModElement.py -> build/lib.linux-i686-2.4/_xmlplus/dom/html copying xml/dom/html/HTMLOListElement.py -> build/lib.linux-i686-2.4/_xmlplus/dom/html copying xml/dom/html/HTMLObjectElement.py -> build/lib.linux-i686-2.4/_xmlplus/dom/html copying xml/dom/html/HTMLOptGroupElement.py -> build/lib.linux-i686-2.4/_xmlplus/dom/html copying xml/dom/html/HTMLOptionElement.py -> build/lib.linux-i686-2.4/_xmlplus/dom/html copying xml/dom/html/HTMLParagraphElement.py -> build/lib.linux-i686-2.4/_xmlplus/dom/html copying xml/dom/html/HTMLParamElement.py -> build/lib.linux-i686-2.4/_xmlplus/dom/html copying xml/dom/html/HTMLPreElement.py -> build/lib.linux-i686-2.4/_xmlplus/dom/html copying xml/dom/html/HTMLQuoteElement.py -> build/lib.linux-i686-2.4/_xmlplus/dom/html copying xml/dom/html/HTMLScriptElement.py -> build/lib.linux-i686-2.4/_xmlplus/dom/html copying xml/dom/html/HTMLSelectElement.py -> build/lib.linux-i686-2.4/_xmlplus/dom/html copying xml/dom/html/HTMLStyleElement.py -> build/lib.linux-i686-2.4/_xmlplus/dom/html copying xml/dom/html/HTMLTableCaptionElement.py -> build/lib.linux-i686-2.4/_xmlplus/dom/html copying xml/dom/html/HTMLTableCellElement.py -> build/lib.linux-i686-2.4/_xmlplus/dom/html copying xml/dom/html/HTMLTableColElement.py -> build/lib.linux-i686-2.4/_xmlplus/dom/html copying xml/dom/html/HTMLTableElement.py -> build/lib.linux-i686-2.4/_xmlplus/dom/html copying xml/dom/html/HTMLTableRowElement.py -> build/lib.linux-i686-2.4/_xmlplus/dom/html copying xml/dom/html/HTMLTableSectionElement.py -> build/lib.linux-i686-2.4/_xmlplus/dom/html copying xml/dom/html/HTMLTextAreaElement.py -> build/lib.linux-i686-2.4/_xmlplus/dom/html copying xml/dom/html/HTMLTitleElement.py -> build/lib.linux-i686-2.4/_xmlplus/dom/html copying xml/dom/html/HTMLUListElement.py -> build/lib.linux-i686-2.4/_xmlplus/dom/html creating build/lib.linux-i686-2.4/_xmlplus/dom/ext copying xml/dom/ext/Dom2Sax.py -> build/lib.linux-i686-2.4/_xmlplus/dom/ext copying xml/dom/ext/Printer.py -> build/lib.linux-i686-2.4/_xmlplus/dom/ext copying xml/dom/ext/Visitor.py -> build/lib.linux-i686-2.4/_xmlplus/dom/ext copying xml/dom/ext/XHtml2HtmlPrinter.py -> build/lib.linux-i686-2.4/_xmlplus/dom/ext copying xml/dom/ext/XHtmlPrinter.py -> build/lib.linux-i686-2.4/_xmlplus/dom/ext copying xml/dom/ext/__init__.py -> build/lib.linux-i686-2.4/_xmlplus/dom/ext copying xml/dom/ext/c14n.py -> build/lib.linux-i686-2.4/_xmlplus/dom/ext creating build/lib.linux-i686-2.4/_xmlplus/dom/ext/reader copying xml/dom/ext/reader/HtmlLib.py -> build/lib.linux-i686-2.4/_xmlplus/dom/ext/reader copying xml/dom/ext/reader/HtmlSax.py -> build/lib.linux-i686-2.4/_xmlplus/dom/ext/reader copying xml/dom/ext/reader/PyExpat.py -> build/lib.linux-i686-2.4/_xmlplus/dom/ext/reader copying xml/dom/ext/reader/Sax.py -> build/lib.linux-i686-2.4/_xmlplus/dom/ext/reader copying xml/dom/ext/reader/Sax2.py -> build/lib.linux-i686-2.4/_xmlplus/dom/ext/reader copying xml/dom/ext/reader/Sax2Lib.py -> build/lib.linux-i686-2.4/_xmlplus/dom/ext/reader copying xml/dom/ext/reader/Sgmlop.py -> build/lib.linux-i686-2.4/_xmlplus/dom/ext/reader copying xml/dom/ext/reader/__init__.py -> build/lib.linux-i686-2.4/_xmlplus/dom/ext/reader creating build/lib.linux-i686-2.4/_xmlplus/marshal copying xml/marshal/__init__.py -> build/lib.linux-i686-2.4/_xmlplus/marshal copying xml/marshal/generic.py -> build/lib.linux-i686-2.4/_xmlplus/marshal copying xml/marshal/wddx.py -> build/lib.linux-i686-2.4/_xmlplus/marshal creating build/lib.linux-i686-2.4/_xmlplus/unicode copying xml/unicode/__init__.py -> build/lib.linux-i686-2.4/_xmlplus/unicode copying xml/unicode/iso8859.py -> build/lib.linux-i686-2.4/_xmlplus/unicode copying xml/unicode/utf8_iso.py -> build/lib.linux-i686-2.4/_xmlplus/unicode creating build/lib.linux-i686-2.4/_xmlplus/parsers copying xml/parsers/__init__.py -> build/lib.linux-i686-2.4/_xmlplus/parsers copying xml/parsers/expat.py -> build/lib.linux-i686-2.4/_xmlplus/parsers copying xml/parsers/sgmllib.py -> build/lib.linux-i686-2.4/_xmlplus/parsers creating build/lib.linux-i686-2.4/_xmlplus/parsers/xmlproc copying xml/parsers/xmlproc/__init__.py -> build/lib.linux-i686-2.4/_xmlplus/parsers/xmlproc copying xml/parsers/xmlproc/_outputters.py -> build/lib.linux-i686-2.4/_xmlplus/parsers/xmlproc copying xml/parsers/xmlproc/catalog.py -> build/lib.linux-i686-2.4/_xmlplus/parsers/xmlproc copying xml/parsers/xmlproc/charconv.py -> build/lib.linux-i686-2.4/_xmlplus/parsers/xmlproc copying xml/parsers/xmlproc/dtdparser.py -> build/lib.linux-i686-2.4/_xmlplus/parsers/xmlproc copying xml/parsers/xmlproc/errors.py -> build/lib.linux-i686-2.4/_xmlplus/parsers/xmlproc copying xml/parsers/xmlproc/namespace.py -> build/lib.linux-i686-2.4/_xmlplus/parsers/xmlproc copying xml/parsers/xmlproc/utils.py -> build/lib.linux-i686-2.4/_xmlplus/parsers/xmlproc copying xml/parsers/xmlproc/xcatalog.py -> build/lib.linux-i686-2.4/_xmlplus/parsers/xmlproc copying xml/parsers/xmlproc/xmlapp.py -> build/lib.linux-i686-2.4/_xmlplus/parsers/xmlproc copying xml/parsers/xmlproc/xmldtd.py -> build/lib.linux-i686-2.4/_xmlplus/parsers/xmlproc copying xml/parsers/xmlproc/xmlproc.py -> build/lib.linux-i686-2.4/_xmlplus/parsers/xmlproc copying xml/parsers/xmlproc/xmlutils.py -> build/lib.linux-i686-2.4/_xmlplus/parsers/xmlproc copying xml/parsers/xmlproc/xmlval.py -> build/lib.linux-i686-2.4/_xmlplus/parsers/xmlproc creating build/lib.linux-i686-2.4/_xmlplus/sax copying xml/sax/__init__.py -> build/lib.linux-i686-2.4/_xmlplus/sax copying xml/sax/_exceptions.py -> build/lib.linux-i686-2.4/_xmlplus/sax copying xml/sax/expatreader.py -> build/lib.linux-i686-2.4/_xmlplus/sax copying xml/sax/handler.py -> build/lib.linux-i686-2.4/_xmlplus/sax copying xml/sax/sax2exts.py -> build/lib.linux-i686-2.4/_xmlplus/sax copying xml/sax/saxexts.py -> build/lib.linux-i686-2.4/_xmlplus/sax copying xml/sax/saxlib.py -> build/lib.linux-i686-2.4/_xmlplus/sax copying xml/sax/saxutils.py -> build/lib.linux-i686-2.4/_xmlplus/sax copying xml/sax/writer.py -> build/lib.linux-i686-2.4/_xmlplus/sax copying xml/sax/xmlreader.py -> build/lib.linux-i686-2.4/_xmlplus/sax creating build/lib.linux-i686-2.4/_xmlplus/sax/drivers copying xml/sax/drivers/__init__.py -> build/lib.linux-i686-2.4/_xmlplus/sax/drivers copying xml/sax/drivers/drv_htmllib.py -> build/lib.linux-i686-2.4/_xmlplus/sax/drivers copying xml/sax/drivers/drv_ltdriver.py -> build/lib.linux-i686-2.4/_xmlplus/sax/drivers copying xml/sax/drivers/drv_ltdriver_val.py -> build/lib.linux-i686-2.4/_xmlplus/sax/drivers copying xml/sax/drivers/drv_pyexpat.py -> build/lib.linux-i686-2.4/_xmlplus/sax/drivers copying xml/sax/drivers/drv_sgmllib.py -> build/lib.linux-i686-2.4/_xmlplus/sax/drivers copying xml/sax/drivers/drv_sgmlop.py -> build/lib.linux-i686-2.4/_xmlplus/sax/drivers copying xml/sax/drivers/drv_xmldc.py -> build/lib.linux-i686-2.4/_xmlplus/sax/drivers copying xml/sax/drivers/drv_xmllib.py -> build/lib.linux-i686-2.4/_xmlplus/sax/drivers copying xml/sax/drivers/drv_xmlproc.py -> build/lib.linux-i686-2.4/_xmlplus/sax/drivers copying xml/sax/drivers/drv_xmlproc_val.py -> build/lib.linux-i686-2.4/_xmlplus/sax/drivers copying xml/sax/drivers/drv_xmltoolkit.py -> build/lib.linux-i686-2.4/_xmlplus/sax/drivers copying xml/sax/drivers/pylibs.py -> build/lib.linux-i686-2.4/_xmlplus/sax/drivers creating build/lib.linux-i686-2.4/_xmlplus/sax/drivers2 copying xml/sax/drivers2/__init__.py -> build/lib.linux-i686-2.4/_xmlplus/sax/drivers2 copying xml/sax/drivers2/drv_htmllib.py -> build/lib.linux-i686-2.4/_xmlplus/sax/drivers2 copying xml/sax/drivers2/drv_javasax.py -> build/lib.linux-i686-2.4/_xmlplus/sax/drivers2 copying xml/sax/drivers2/drv_pyexpat.py -> build/lib.linux-i686-2.4/_xmlplus/sax/drivers2 copying xml/sax/drivers2/drv_sgmllib.py -> build/lib.linux-i686-2.4/_xmlplus/sax/drivers2 copying xml/sax/drivers2/drv_sgmlop.py -> build/lib.linux-i686-2.4/_xmlplus/sax/drivers2 copying xml/sax/drivers2/drv_sgmlop_html.py -> build/lib.linux-i686-2.4/_xmlplus/sax/drivers2 copying xml/sax/drivers2/drv_xmlproc.py -> build/lib.linux-i686-2.4/_xmlplus/sax/drivers2 creating build/lib.linux-i686-2.4/_xmlplus/utils copying xml/utils/__init__.py -> build/lib.linux-i686-2.4/_xmlplus/utils copying xml/utils/characters.py -> build/lib.linux-i686-2.4/_xmlplus/utils copying xml/utils/iso8601.py -> build/lib.linux-i686-2.4/_xmlplus/utils copying xml/utils/qp_xml.py -> build/lib.linux-i686-2.4/_xmlplus/utils creating build/lib.linux-i686-2.4/_xmlplus/schema copying xml/schema/__init__.py -> build/lib.linux-i686-2.4/_xmlplus/schema copying xml/schema/trex.py -> build/lib.linux-i686-2.4/_xmlplus/schema creating build/lib.linux-i686-2.4/_xmlplus/xpath copying xml/xpath/BuiltInExtFunctions.py -> build/lib.linux-i686-2.4/_xmlplus/xpath copying xml/xpath/Context.py -> build/lib.linux-i686-2.4/_xmlplus/xpath copying xml/xpath/Conversions.py -> build/lib.linux-i686-2.4/_xmlplus/xpath copying xml/xpath/CoreFunctions.py -> build/lib.linux-i686-2.4/_xmlplus/xpath copying xml/xpath/ExpandedNameWrapper.py -> build/lib.linux-i686-2.4/_xmlplus/xpath copying xml/xpath/MessageSource.py -> build/lib.linux-i686-2.4/_xmlplus/xpath copying xml/xpath/NamespaceNode.py -> build/lib.linux-i686-2.4/_xmlplus/xpath copying xml/xpath/ParsedAbbreviatedAbsoluteLocationPath.py -> build/lib.linux-i686-2.4/_xmlplus/xpath copying xml/xpath/ParsedAbbreviatedRelativeLocationPath.py -> build/lib.linux-i686-2.4/_xmlplus/xpath copying xml/xpath/ParsedAbsoluteLocationPath.py -> build/lib.linux-i686-2.4/_xmlplus/xpath copying xml/xpath/ParsedAxisSpecifier.py -> build/lib.linux-i686-2.4/_xmlplus/xpath copying xml/xpath/ParsedExpr.py -> build/lib.linux-i686-2.4/_xmlplus/xpath copying xml/xpath/ParsedNodeTest.py -> build/lib.linux-i686-2.4/_xmlplus/xpath copying xml/xpath/ParsedPredicateList.py -> build/lib.linux-i686-2.4/_xmlplus/xpath copying xml/xpath/ParsedStep.py -> build/lib.linux-i686-2.4/_xmlplus/xpath copying xml/xpath/ParsedRelativeLocationPath.py -> build/lib.linux-i686-2.4/_xmlplus/xpath copying xml/xpath/Set.py -> build/lib.linux-i686-2.4/_xmlplus/xpath copying xml/xpath/Util.py -> build/lib.linux-i686-2.4/_xmlplus/xpath copying xml/xpath/XPathGrammar.py -> build/lib.linux-i686-2.4/_xmlplus/xpath copying xml/xpath/XPathParser.py -> build/lib.linux-i686-2.4/_xmlplus/xpath copying xml/xpath/XPathParserBase.py -> build/lib.linux-i686-2.4/_xmlplus/xpath copying xml/xpath/__init__.py -> build/lib.linux-i686-2.4/_xmlplus/xpath copying xml/xpath/pyxpath.py -> build/lib.linux-i686-2.4/_xmlplus/xpath copying xml/xpath/yappsrt.py -> build/lib.linux-i686-2.4/_xmlplus/xpath running build_ext Traceback (most recent call last): File "setup.py", line 231, in ? scripts = ['scripts/xmlproc_parse', 'scripts/xmlproc_val'] File "/usr/lib/python2.4/distutils/core.py", line 149, in setup dist.run_commands() File "/usr/lib/python2.4/distutils/dist.py", line 946, in run_commands self.run_command(cmd) File "/usr/lib/python2.4/distutils/dist.py", line 966, in run_command cmd_obj.run() File "/usr/lib/python2.4/distutils/command/build.py", line 112, in run self.run_command(cmd_name) File "/usr/lib/python2.4/distutils/cmd.py", line 333, in run_command self.distribution.run_command(command) File "/usr/lib/python2.4/distutils/dist.py", line 966, in run_command cmd_obj.run() File "/usr/lib/python2.4/distutils/command/build_ext.py", line 254, in run customize_compiler(self.compiler) File "/usr/lib/python2.4/distutils/sysconfig.py", line 161, in customize_compiler cpp = cc + " -E" # not always TypeError: unsupported operand type(s) for +: 'NoneType' and 'str' From Jstitch13 at aol.com Sat Jan 7 08:05:44 2006 From: Jstitch13 at aol.com (Jstitch13 at aol.com) Date: Sat, 7 Jan 2006 02:05:44 EST Subject: [XML-SIG] Buy Vicodin online today, overnight shipping xyiz kccg v Message-ID: <1a4.4654988d.30f0c248@aol.com> -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/xml-sig/attachments/20060107/5e63714b/attachment.htm From martin at v.loewis.de Sat Jan 7 13:06:49 2006 From: martin at v.loewis.de (=?ISO-8859-1?Q?=22Martin_v=2E_L=F6wis=22?=) Date: Sat, 07 Jan 2006 13:06:49 +0100 Subject: [XML-SIG] trouble installing PyXML package In-Reply-To: <20060105143821.x1ebmd546ccw0c44@www.webmail.nl.demon.net> References: <20060105143821.x1ebmd546ccw0c44@www.webmail.nl.demon.net> Message-ID: <43BFAED9.1060201@v.loewis.de> PyXML at fcl.demon.nl wrote: > Trying "sudo python setup.py install" gives me the same results. I have no idea > what can be the problem but I suspect the setup script expected me to provide a > parameter? No. Something is wrong with your Python installation. Where did you get that Python installation from? If you installed it yourself, how precisely did you do that? Do you have a file /usr/lib/python2.4/config/Makefile? As a work-around, try setting the environment variable CC to "gcc". Regards, Martin From vishal at veriwave.com Tue Jan 10 19:07:25 2006 From: vishal at veriwave.com (Vishal Bhargava) Date: Tue, 10 Jan 2006 10:07:25 -0800 Subject: [XML-SIG] Regd. PyXML In-Reply-To: <43BFAED9.1060201@v.loewis.de> Message-ID: <200601101807.k0AI7QYI007723@cia.veriwave.com> Hello All: I needed some help with Python and XML. I have a python file consisting of dictionary elements and I would like to build an XML document from that. I would also like to parse that XML document back and build the dictionary from that as well. Thanks for all the help. Cheers, Vishal -----Original Message----- From: xml-sig-bounces at python.org [mailto:xml-sig-bounces at python.org] On Behalf Of "Martin v. L?wis" Sent: Saturday, January 07, 2006 4:07 AM To: PyXML at fcl.demon.nl Cc: xml-sig at python.org Subject: Re: [XML-SIG] trouble installing PyXML package PyXML at fcl.demon.nl wrote: > Trying "sudo python setup.py install" gives me the same results. I have no idea > what can be the problem but I suspect the setup script expected me to provide a > parameter? No. Something is wrong with your Python installation. Where did you get that Python installation from? If you installed it yourself, how precisely did you do that? Do you have a file /usr/lib/python2.4/config/Makefile? As a work-around, try setting the environment variable CC to "gcc". Regards, Martin _______________________________________________ XML-SIG maillist - XML-SIG at python.org http://mail.python.org/mailman/listinfo/xml-sig From jeremy.kloth at fourthought.com Thu Jan 12 00:21:14 2006 From: jeremy.kloth at fourthought.com (Jeremy Kloth) Date: Wed, 11 Jan 2006 16:21:14 -0700 Subject: [XML-SIG] [XML-checkins]Evaluate on nodes In-Reply-To: <16706d0f0601111510g35866ebes4700c480eee70e5e@mail.gmail.com> References: <16706d0f0601111506l6591a78dwe2c1b6c7bd54c0f9@mail.gmail.com> <16706d0f0601111510g35866ebes4700c480eee70e5e@mail.gmail.com> Message-ID: <200601111621.14907.jeremy.kloth@fourthought.com> On Wednesday 11 January 2006 16:10, Vladimir Blagojevic wrote: > Hi, > > I am new to PyXml and I am struggling with xpath evaluation. Namely, > if I pass a node to the Evaluate function instead of the whole > document, I would expect the xpath evaluation to start from that node, > not from its containing document. > > Let me illustrate my problem with an example: > > doc = > minidom.parseString('ble>') print len(xpath.Evaluate('//tr', doc.documentElement)) > 3 > td = xpath.Evaluate('//td', doc.documentElement)[0] > print len(xpath.Evaluate('//tr', td)) > 3 > > I would expect 1, since the td element only contains onew descendant > tr element. > > If one looks at the code of ParsedAbbreviatedAbsoluteLocationPath.py, > we see why: > > root = context.node.ownerDocument or context.node > > I would expect this to read: > > root = context.node or context.node.ownerDocument If you change your expression to read ".//tr", an AbbreviatedRelativeLocationPath, you should get the result you are expecting. -- Jeremy Kloth http://fourthought.com/ http://4suite.org/ From ifcmortgageman at ameritech.net Fri Jan 13 20:14:19 2006 From: ifcmortgageman at ameritech.net (Rommie Bailey) Date: Fri, 13 Jan 2006 14:14:19 -0500 Subject: [XML-SIG] Fw: here Message-ID: <013101c61875$9eb4d810$6401a8c0@mortgage> I received This. ----- Original Message ----- From: To: Sent: Friday, January 13, 2006 10:25 AM Subject: Re: here > Please read the document. > > -------------------------------------------------------------------------------- > *************************** VIRUS REMOVED > *************************** > > An attachment has been removed because it contained a virus. > > *************************** VIRUS REMOVED > *************************** > > Virus name: [W32/Netsky.p at MM!zip] > Virus scanner: [Network Associates] > Attachment name: [text.zip] > Attachment type: [application/octet-stream] > From sbaush at gmail.com Tue Jan 17 17:07:20 2006 From: sbaush at gmail.com (Sbaush) Date: Tue, 17 Jan 2006 17:07:20 +0100 Subject: [XML-SIG] XML Writer from wxPython GUI Message-ID: Hi all. I'm developing a User Interface with wxPython. From this GUI a user should be able to crate a xml string. The GUI show a lot of commands that the user can choose. The GUI have to write the user's choice in a XML file. This is not more dofferent from a XML editor... What's the best way to do it? Have you ever do an application like this? Thanks. -- Sbaush -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/xml-sig/attachments/20060117/ca207938/attachment.html From jvines at arl.army.mil Thu Jan 19 14:30:53 2006 From: jvines at arl.army.mil (Vines, John (Civ, ARL/CISD)) Date: Thu, 19 Jan 2006 08:30:53 -0500 Subject: [XML-SIG] Does PyXML support validating with schemas Message-ID: I'm new to PyXML and have a question with regards to validating a document using a schema as opposed to using a DTD. Does the validating parser in xmlproc support validating with schemas? If so could you point me in the direction of some examples? Thanks in advance, John Vines ARL MSRC HPCD, CSEB Scientific Visualization Team -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/xml-sig/attachments/20060119/fc477835/attachment.htm From sbaush at gmail.com Thu Jan 19 14:49:05 2006 From: sbaush at gmail.com (Sbaush) Date: Thu, 19 Jan 2006 14:49:05 +0100 Subject: [XML-SIG] Dom or MiniDom example Message-ID: Hi, i'm searching for a dom or a minidom examples. I'm building a GUI. This gui should create a XML string. What's the best way to implement this? Dom, minidom or another way? Thanks. -- Sbaush -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/xml-sig/attachments/20060119/e7da23be/attachment.html From sbaush at gmail.com Thu Jan 19 17:19:55 2006 From: sbaush at gmail.com (Sbaush) Date: Thu, 19 Jan 2006 17:19:55 +0100 Subject: [XML-SIG] Howto create this XML string? In-Reply-To: References: Message-ID: Hi all. I've this XML: How can i write this in a Python String? I would like use a xml.domimplementation and not a banal print...print... I can't do it... Is there anyone that can explain me what is the way? Thank you! -- Sbaush -- Sbaush -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/xml-sig/attachments/20060119/b06405f5/attachment.html From mmclay at comcast.net Thu Jan 19 18:50:27 2006 From: mmclay at comcast.net (Michael McLay) Date: Thu, 19 Jan 2006 12:50:27 -0500 Subject: [XML-SIG] Howto create this XML string? In-Reply-To: References: Message-ID: <200601191250.27531.mmclay@comcast.net> On Thursday 19 January 2006 11:19, Sbaush wrote: > Hi all. > I've this XML: > > > > > > > > > > > > How can i write this in a Python String? I would like use a > xml.domimplementation and not a banal print...print... > I can't do it... Is there anyone that can explain me what is the way? > Thank you! This is pretty easy to do using ElementTree and cEleementTree. (These packages will be included in the standard Python distribution starting with 1.5.) Here's a script that shows three ways of doing what you requested. import sys import cElementTree as ET root = ET.Element('manager') request = ET.SubElement(root, "request") append = ET.SubElement(request, "append") append.set('mode','INPUT') method = ET.SubElement(append, "method") method.set('type','GOOD') source = ET.SubElement(method, "source") source.set('address','127.0.0.1') action = ET.SubElement(method, "action") action.set('option','OK') tree = ET.ElementTree(root) tree.write(sys.stdout) print '\n\n\n next add some white space for pretty printing\n' root = ET.Element('manager') root.text='\n ' request = ET.SubElement(root, "request") request.text='\n ' request.tail='\n' append = ET.SubElement(request, "append") append.set('mode','INPUT') append.text= '\n ' append.tail= '\n ' method = ET.SubElement(append, "method") method.set('type','GOOD') method.tail='\n ' source = ET.SubElement(append, "source") source.set('address','127.0.0.1') source.tail= '\n ' action = ET.SubElement(append, "action") action.set('option','OK') action.tail='\n ' tree = ET.ElementTree(root) tree.write(sys.stdout) # the trailing tags can also be print "\n\n\nHere's an example from http://effbot.org/zone/xml-writer.htm\n" from elementtree.SimpleXMLWriter import XMLWriter import sys w = XMLWriter(sys.stdout) html = w.start("html") w.start("head") w.element("title", "my document") w.element("meta", name="generator", value="my application 1.0") w.end() w.start("body") w.element("h1", "this is a heading") w.element("p", "this is a paragraph") w.start("p") w.data("this is ") w.element("b", "bold") w.data(" and ") w.element("i", "italic") w.data(".") w.end("p") w.close(html) This script produces the following output: next add some white space for pretty printing Here's a different example from http://effbot.org/zone/xml-writer.htm my document

this is a heading

this is a paragraph

this is bold and italic.

From morillas at gmail.com Thu Jan 19 20:04:27 2006 From: morillas at gmail.com (Luis Miguel Morillas) Date: Thu, 19 Jan 2006 20:04:27 +0100 Subject: [XML-SIG] Howto create this XML string? In-Reply-To: References: Message-ID: <68d25cbc0601191104o15367f4fs@mail.gmail.com> 2006/1/19, Sbaush : > > Hi all. > I've this XML: > > > > > > > > > > > > How can i write this in a Python String? I would like use a xml.domimplementation and not a banal print...print... > I can't do it... Is there anyone that can explain me what is the way? > Thank you! Another taste with amara: import amara doc = amara.create_document(u"manager") doc.manager.xml_append(doc.xml_create_element(u'request')) doc.manager.request.xml_append(doc.xml_create_element( u'append', attributes={u'mode':u'INPUT'})) doc.manager.request.append.xml_append(doc.xml_create_element( u'method', attributes={u'type':u'GOOD'})) doc.manager.request.append.xml_append(doc.xml_create_element( u'source', attributes={u'source':u'127.0.0.1'})) doc.manager.request.append.xml_append(doc.xml_create_element( u'action', attributes={u'option':u'OK'})) print doc.xml(indent='yes') -- Luis Miguel -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/xml-sig/attachments/20060119/66fc98b3/attachment.htm From mr_ankit_rastogi at yahoo.com Fri Jan 20 05:52:55 2006 From: mr_ankit_rastogi at yahoo.com (Ankit Rastogi) Date: Thu, 19 Jan 2006 20:52:55 -0800 (PST) Subject: [XML-SIG] Does PyXML support validating with schemas In-Reply-To: Message-ID: <20060120045255.96930.qmail@web54101.mail.yahoo.com> PyXml itself doesn't provide schema support. There are some other packages availaible which can be installed with pyxml for schema support. Have a look to it: - XSV: currently in progress, and provides XML schema Part 1: Structures. Dependent on some other pacakage PyLTXML(http://www.ltg.ed.ac.uk/~ht/xsv-status.html) LTXML (http://www.ltg.ed.ac.uk/software/xml/) - minixsv: http://www.leuthe.homepage.t-online.de/minixsv/minixsv_overview.html Or you can go with some other package instead of pyXml: - libxml2 which has nice schema support (http://xmlsoft.org/index.html). -- Regards Ankit Rastogi "Vines, John (Civ, ARL/CISD)" wrote: I'm new to PyXML and have a question with regards to validating a document using a schema as opposed to using a DTD. Does the validating parser in xmlproc support validating with schemas? If so could you point me in the direction of some examples? Thanks in advance, John Vines ARL MSRC HPCD, CSEB Scientific Visualization Team _______________________________________________ XML-SIG maillist - XML-SIG at python.org http://mail.python.org/mailman/listinfo/xml-sig --------------------------------- Yahoo! Photos Got holiday prints? See all the ways to get quality prints in your hands ASAP. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/xml-sig/attachments/20060119/d37fb2d7/attachment.html From sbaush at gmail.com Fri Jan 20 11:30:27 2006 From: sbaush at gmail.com (Sbaush) Date: Fri, 20 Jan 2006 11:30:27 +0100 Subject: [XML-SIG] Howto create this XML string? In-Reply-To: References: <1137691302.83.1977@mint-julep.mondoinfo.com> Message-ID: hi, i've tested the matthew way, and it work perfectly. Is possible to have the XML in a string (for example xmlstring) and for printing do a print xmlstring ? The Matthew way is import sys import elementtree.ElementTree as ET root = ET.Element("manager") req=ET.SubElement(root,"request") app=ET.SubElement(req,"append") app.set("mode","INPUT") met=ET.SubElement(app,"method") met.set("type","GOOD") src=ET.SubElement(app,"source") src.set("address","127.0.0.1 ") act=ET.SubElement(app,"action") act.set("option","OK") tree = ET.ElementTree(root) tree.write(sys.stdout) print $ python et.py 2006/1/19, Matthew Dixon Cowles < matt at mondoinfo.com>: > > Dear Sbaush, > > > Hi all. > > I've this XML: > > > > > > > > > > > > > > > > > > > > > > > > How can i write this in a Python String? I would like use a > > xml.domimplementation and not a banal print...print... > > Using Fredrik Lundh's ElementTree from: > > http://effbot.org/zone/element-index.htm > > you could do something like: > > import sys > import elementtree.ElementTree as ET > > root = ET.Element("manager") > req=ET.SubElement(root,"request") > app=ET.SubElement(req,"append") > app.set("mode","INPUT") > met=ET.SubElement(app,"method") > met.set("type","GOOD") > src=ET.SubElement(app,"source") > src.set("address"," 127.0.0.1") > act=ET.SubElement(app,"action") > act.set("option","OK") > > tree = ET.ElementTree(root) > tree.write(sys.stdout) > print > > $ python et.py > address="127.0.0.1" /> /> > > Regards, > Matt > > -- Sbaush -- Sbaush -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/xml-sig/attachments/20060120/8437be0d/attachment-0001.html From fredrik at pythonware.com Fri Jan 20 11:37:04 2006 From: fredrik at pythonware.com (Fredrik Lundh) Date: Fri, 20 Jan 2006 11:37:04 +0100 Subject: [XML-SIG] Howto create this XML string? References: <1137691302.83.1977@mint-julep.mondoinfo.com> Message-ID: Sbaush wrote: > Is possible to have the XML in a string (for example xmlstring) and for > printing do a print xmlstring ? most about anything that can be written to a file can be written to a string using the StringIO module: http://www.effbot.org/librarybook/stringio.htm file = StringIO.StringIO() tree.write(file) data = file.getvalue() for elementtree, you can also use the tostring function: data = ET.tostring(elem) From sbaush at gmail.com Fri Jan 20 12:43:57 2006 From: sbaush at gmail.com (Sbaush) Date: Fri, 20 Jan 2006 12:43:57 +0100 Subject: [XML-SIG] Howto create this XML string? In-Reply-To: References: <1137691302.83.1977@mint-julep.mondoinfo.com> Message-ID: I have tree = ET.ElementTree(root) How can i put tree in a string? 2006/1/20, Fredrik Lundh : > > Sbaush wrote: > > > Is possible to have the XML in a string (for example xmlstring) and for > > printing do a print xmlstring ? > > most about anything that can be written to a file can be written to a > string > using the StringIO module: > > http://www.effbot.org/librarybook/stringio.htm > > file = StringIO.StringIO() > tree.write(file) > data = file.getvalue() > > for elementtree, you can also use the tostring function: > > data = ET.tostring(elem) > > > > > > _______________________________________________ > XML-SIG maillist - XML-SIG at python.org > http://mail.python.org/mailman/listinfo/xml-sig > -- Sbaush -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/xml-sig/attachments/20060120/131b6ca6/attachment.htm From sbaush at gmail.com Fri Jan 20 11:09:53 2006 From: sbaush at gmail.com (Sbaush) Date: Fri, 20 Jan 2006 11:09:53 +0100 Subject: [XML-SIG] Howto create this XML string? In-Reply-To: <68d25cbc0601191104o15367f4fs@mail.gmail.com> References: <68d25cbc0601191104o15367f4fs@mail.gmail.com> Message-ID: Thanks all, i've perfectly undestand the way. Thanks again. 2006/1/19, Luis Miguel Morillas : > > > > 2006/1/19, Sbaush : > > > > Hi all. > > I've this XML: > > > > > > > > > > > > > > > > > > > > > > > > How can i write this in a Python String? I would like use a xml.domimplementation and not a banal print...print... > > I can't do it... Is there anyone that can explain me what is the way? > > Thank you! > > > > Another taste with amara: > > import amara > doc = amara.create_document (u"manager") > doc.manager.xml_append(doc.xml_create_element(u'request')) > doc.manager.request.xml_append(doc.xml_create_element( > u'append', > attributes={u'mode':u'INPUT'})) > doc.manager.request.append.xml_append (doc.xml_create_element( > u'method', > attributes={u'type':u'GOOD'})) > doc.manager.request.append.xml_append(doc.xml_create_element( > u'source', > attributes={u'source':u' 127.0.0.1'})) > doc.manager.request.append.xml_append(doc.xml_create_element( > u'action', > attributes={u'option':u'OK'})) > print doc.xml(indent='yes') > > > > > -- > > Luis Miguel > _______________________________________________ > XML-SIG maillist - XML-SIG at python.org > http://mail.python.org/mailman/listinfo/xml-sig > > > -- Sbaush -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/xml-sig/attachments/20060120/afad4b6e/attachment.htm From juha.rantanen at hut.fi Tue Jan 24 09:24:21 2006 From: juha.rantanen at hut.fi (Juha Rantanen) Date: Tue, 24 Jan 2006 10:24:21 +0200 (EET) Subject: [XML-SIG] XSLT transforming with Python Message-ID: Hi, I'm creating software that writes simple xml log and transforms it to html. I have been looking for library that could be easily included to my software. My software should work with Python and it should be platform independent. I have checked 4Suite and PyXML and I'm thinking those aren't an option, because those have to be installed separately. Or does anyone know easy way to add those to my code as library. I'm not sure, but because there is some c code which have to be compiled during installation, those packages are hard to use as library. Especially, when the resulting software should be platform independent. So does anyone know, is there any XSLT component that could be easily included to my software? Br, Juha Rantanen From dkuhlman at cutter.rexx.com Tue Jan 24 18:31:47 2006 From: dkuhlman at cutter.rexx.com (Dave Kuhlman) Date: Tue, 24 Jan 2006 09:31:47 -0800 Subject: [XML-SIG] XSLT transforming with Python In-Reply-To: References: Message-ID: <20060124173147.GA92258@cutter.rexx.com> On Tue, Jan 24, 2006 at 10:24:21AM +0200, Juha Rantanen wrote: > Hi, > > I'm creating software that writes simple xml log and transforms it to > html. I have been looking for library that could be easily included to my > software. My software should work with Python and it should be platform > independent. *Not* your solution, because it is not platform independent, but for others listening for an answer to your question -- lxml has XSLT support. See: http://codespeak.net/lxml/ lxml is build on libxml, which must be installed separately and which includes C code. Dave -- Dave Kuhlman http://www.rexx.com/~dkuhlman From evdo.hsdpa at gmail.com Tue Jan 24 18:58:46 2006 From: evdo.hsdpa at gmail.com (Robert Kim Wireless Internet Advisor) Date: Tue, 24 Jan 2006 09:58:46 -0800 Subject: [XML-SIG] XSLT transforming with Python In-Reply-To: <20060124173147.GA92258@cutter.rexx.com> References: <20060124173147.GA92258@cutter.rexx.com> Message-ID: <1ec620e90601240958n77a0cd19yc5dc303b795b8ff9@mail.gmail.com> Unfortunately, i think dave is right.. sorry bob On 1/24/06, Dave Kuhlman wrote: > On Tue, Jan 24, 2006 at 10:24:21AM +0200, Juha Rantanen wrote: > > Hi, > > > > I'm creating software that writes simple xml log and transforms it to > > html. I have been looking for library that could be easily included to my > > software. My software should work with Python and it should be platform > > independent. > > *Not* your solution, because it is not platform independent, but > for others listening for an answer to your question -- lxml has > XSLT support. See: > > http://codespeak.net/lxml/ > > lxml is build on libxml, which must be installed separately and > which includes C code. > > Dave > > > -- > Dave Kuhlman > http://www.rexx.com/~dkuhlman > _______________________________________________ > XML-SIG maillist - XML-SIG at python.org > http://mail.python.org/mailman/listinfo/xml-sig > -- Robert Q Kim, Wireless Internet Advisor http://evdo-coverage.com/cell-repeater.html http://hsdpa-coverage.com 2611 S. Pacific Coast Highway 101 Suite 102 Cardiff by the Sea, CA 92007 206 984 0880 From dieter at handshake.de Tue Jan 24 21:02:57 2006 From: dieter at handshake.de (Dieter Maurer) Date: Tue, 24 Jan 2006 21:02:57 +0100 Subject: [XML-SIG] XSLT transforming with Python In-Reply-To: References: Message-ID: <17366.34801.53340.500276@gargle.gargle.HOWL> Juha Rantanen wrote at 2006-1-24 10:24 +0200: > ... >I have checked 4Suite and PyXML and I'm thinking those aren't an option, >because those have to be installed separately. Or does anyone know easy >way to add those to my code as library. Provided, you have a C development system for all of your platforms, installation will be trivial: "python setup.py install". For Windows, you will usually get binaries. For other platform, you usually can install the GNU C development system easily. -- Dieter From vishal at veriwave.com Tue Jan 24 22:57:13 2006 From: vishal at veriwave.com (Vishal Bhargava) Date: Tue, 24 Jan 2006 13:57:13 -0800 Subject: [XML-SIG] Help Needed with Element Tree In-Reply-To: <17366.34801.53340.500276@gargle.gargle.HOWL> Message-ID: <200601242157.k0OLvFYI024969@cia.veriwave.com> Hello All: I have an XML format that I have created using data collected from Different dictionaries. I am changing the file extension of this XML file to something else, e.g. .wml extension, so when I open this file using notepad the whole file is totally flat, that means the all the data that I have in the XML file whose extension I just changed gets printed out into 1 single line. Is there no way that we can take care of formatting the file, during the building of the XML file using the Element Tree Module. Thanks for all the help. Cheers, Vishal -----Original Message----- From: xml-sig-bounces at python.org [mailto:xml-sig-bounces at python.org] On Behalf Of Dieter Maurer Sent: Tuesday, January 24, 2006 12:03 PM To: Juha Rantanen Cc: xml-sig at python.org Subject: Re: [XML-SIG] XSLT transforming with Python Juha Rantanen wrote at 2006-1-24 10:24 +0200: > ... >I have checked 4Suite and PyXML and I'm thinking those aren't an option, >because those have to be installed separately. Or does anyone know easy >way to add those to my code as library. Provided, you have a C development system for all of your platforms, installation will be trivial: "python setup.py install". For Windows, you will usually get binaries. For other platform, you usually can install the GNU C development system easily. -- Dieter _______________________________________________ XML-SIG maillist - XML-SIG at python.org http://mail.python.org/mailman/listinfo/xml-sig From dkgunter at lbl.gov Wed Jan 25 06:26:36 2006 From: dkgunter at lbl.gov (Dan Gunter) Date: Tue, 24 Jan 2006 21:26:36 -0800 Subject: [XML-SIG] Help Needed with Element Tree In-Reply-To: <200601242157.k0OLvFYI024969@cia.veriwave.com> References: <200601242157.k0OLvFYI024969@cia.veriwave.com> Message-ID: <43D70C0C.1070802@lbl.gov> Vishal Bhargava wrote: >Hello All: >I have an XML format that I have created using data collected from >Different dictionaries. I am changing the file extension of this XML file >to something else, e.g. .wml extension, so when I open this file using >notepad the whole file is totally flat, that means the all the data that I >have in the XML file whose extension I just changed gets printed out into 1 >single line. Is there no way that we can take care of formatting the file, >during the building of the XML file using the Element Tree Module. Thanks >for all the help. >Cheers, >Vishal > > > > last I heard elementtree didn't have a pretty print, but it is not hard to hack in yourself; or just run something like HTML Tidy over the file post-hoc. Not terribly efficient, but if you're opening it in notepad, it couldn't be that big.. -Dan From fredrik at pythonware.com Wed Jan 25 08:35:25 2006 From: fredrik at pythonware.com (Fredrik Lundh) Date: Wed, 25 Jan 2006 08:35:25 +0100 Subject: [XML-SIG] Help Needed with Element Tree References: <17366.34801.53340.500276@gargle.gargle.HOWL> <200601242157.k0OLvFYI024969@cia.veriwave.com> Message-ID: Vishal Bhargava wrote: > I have an XML format that I have created using data collected from > Different dictionaries. I am changing the file extension of this XML file > to something else, e.g. .wml extension, so when I open this file using > notepad the whole file is totally flat, that means the all the data that I > have in the XML file whose extension I just changed gets printed out into 1 > single line. Is there no way that we can take care of formatting the file, > during the building of the XML file using the Element Tree Module. Thanks > for all the help. the file is perfectly valid XML, even if it doesn't contain any extra newlines. if you want it to print more nicely, you can set the "tail" attribute to "\n" for relevant elements. or you can run something like the snipped in this post http://article.gmane.org/gmane.comp.python.xml/3741 before you save the file. From sbaush at gmail.com Fri Jan 27 12:55:58 2006 From: sbaush at gmail.com (Sbaush) Date: Fri, 27 Jan 2006 12:55:58 +0100 Subject: [XML-SIG] Represent XML In-Reply-To: References: Message-ID: Hi all. I attach to you a example XML file to parse and the demo of my objective. The iptRequest.xml is the file to parse in one mode. I can't parse it. The demo.py is my ideal result, manually built, that should be built by parsing the XML. How can i do to do it? Bye all! -- Sbaush -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/xml-sig/attachments/20060127/415debf0/attachment.html -------------- next part -------------- A non-text attachment was scrubbed... Name: demo.py Type: text/x-python Size: 4274 bytes Desc: not available Url : http://mail.python.org/pipermail/xml-sig/attachments/20060127/415debf0/attachment.py -------------- next part -------------- A non-text attachment was scrubbed... Name: iptRequest.xml Type: text/xml Size: 1253 bytes Desc: not available Url : http://mail.python.org/pipermail/xml-sig/attachments/20060127/415debf0/attachment.bin From sbaush at gmail.com Fri Jan 27 16:52:16 2006 From: sbaush at gmail.com (Sbaush) Date: Fri, 27 Jan 2006 16:52:16 +0100 Subject: [XML-SIG] Represent XML In-Reply-To: <68d25cbc0601270745l22207c1ah@mail.gmail.com> References: <68d25cbc0601270745l22207c1ah@mail.gmail.com> Message-ID: Thanks very much for your answer... One question:why amara is the best solution? Can't we do it with the standard python xml.dom or minidom? 2006/1/27, Luis Miguel Morillas : > > > > 2006/1/27, Sbaush : > > > > Hi all. > > I attach to you a example XML file to parse and the demo of my > > objective. > > The iptRequest.xml is the file to parse in one mode. I can't parse it. > > The demo.py is my ideal result, manually built, that should be built by > > parsing the XML. > > How can i do to do it? > > Bye all! > > > > Easy, here you have the data you need, then compose your strings :) > > import amara > doc = amara.parse('iptRequest.xml') > for table in doc.xml_xpath (u'//table'): > data = {} > data['chain'] = table.chain > data['poli'] = table.policy > for rule in table.xml_children: > if not isinstance(rule, unicode): > for at in rule.xml_attributes.keys (): > data[at] = eval('rule.'+at) > print data # now build your string > > > > Saludos, > > -- > > Luis Miguel -- Sbaush -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/xml-sig/attachments/20060127/571b3cc3/attachment.htm From morillas at gmail.com Fri Jan 27 17:50:45 2006 From: morillas at gmail.com (Luis Miguel Morillas) Date: Fri, 27 Jan 2006 17:50:45 +0100 Subject: [XML-SIG] Represent XML In-Reply-To: <68d25cbc0601270745l22207c1ah@mail.gmail.com> References: <68d25cbc0601270745l22207c1ah@mail.gmail.com> Message-ID: <68d25cbc0601270850h7a7d237bu@mail.gmail.com> 2006/1/27, Sbaush : > > Hi all. > I attach to you a example XML file to parse and the demo of my objective. > The iptRequest.xml is the file to parse in one mode. I can't parse it. > The demo.py is my ideal result, manually built, that should be built by > parsing the XML. > How can i do to do it? > Bye all! > Easy, here you have the data you need, then compose your strings :) import amara doc = amara.parse('iptRequest.xml') for table in doc.xml_xpath (u'//table'): data = {} data['chain'] = table.chain data['poli'] = table.policy for rule in table.xml_children: if not isinstance(rule, unicode): for at in rule.xml_attributes.keys (): data[at] = eval('rule.'+at) print data # now build your string Saludos, -- Luis Miguel -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/xml-sig/attachments/20060127/207e641a/attachment.html From morillas at gmail.com Fri Jan 27 20:00:12 2006 From: morillas at gmail.com (Luis Miguel Morillas) Date: Fri, 27 Jan 2006 20:00:12 +0100 Subject: [XML-SIG] Represent XML In-Reply-To: References: <68d25cbc0601270745l22207c1ah@mail.gmail.com> Message-ID: <68d25cbc0601271100h611446fbw@mail.gmail.com> 2006/1/27, Sbaush : > > Thanks very much for your answer... > One question:why amara is the best solution? Can't we do it with the > standard python xml.dom or minidom? > Sure you can, And you can do it with xslt too, but I think it's a question of taste. Amara is the easiest way for me :) Saludos, -- Luis Miguel -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/xml-sig/attachments/20060127/1335096d/attachment.html