Re: Which one is the best XML-parser?

2016-07-02 Thread Stefan Behnel
Random832 schrieb am 24.06.2016 um 15:09: > On Fri, Jun 24, 2016, at 02:39, dieter wrote: >> You want an incremental parser if the XML documents are so huge that >> you must process them incrementally rather than have a data structure >> representing the whole document (in memory). Incremental pars

Re: Which one is the best XML-parser?

2016-06-24 Thread Ned Batchelder
On Friday, June 24, 2016 at 8:44:49 PM UTC-4, Sayth Renshaw wrote: > On Friday, 24 June 2016 07:03:18 UTC+10, David Shi wrote: > > Which one is the best XML-parser? > > Can any one tell me? > > Regards. > > David > > Most use lxml http://lxml.de/index.html &g

Re: Which one is the best XML-parser?

2016-06-24 Thread lorenzo . gatti
On Thursday, June 23, 2016 at 11:03:18 PM UTC+2, David Shi wrote: > Which one is the best XML-parser? > Can any one tell me? > Regards. > David Lxml offers lxml.etree.iterparse (http://lxml.de/tutorial.html#event-driven-parsing), an important combination of the memory savings of

Re: Which one is the best XML-parser?

2016-06-24 Thread Sayth Renshaw
On Friday, 24 June 2016 07:03:18 UTC+10, David Shi wrote: > Which one is the best XML-parser? > Can any one tell me? > Regards. > David Most use lxml http://lxml.de/index.html Sayth -- https://mail.python.org/mailman/listinfo/python-list

Re: Which one is the best XML-parser?

2016-06-24 Thread Sayth Renshaw
On Friday, 24 June 2016 07:03:18 UTC+10, David Shi wrote: > Which one is the best XML-parser? > Can any one tell me? > Regards. > David xml parser most use lxml http://lxml.de/index.html Sayth -- https://mail.python.org/mailman/listinfo/python-list

Re: Which one is the best XML-parser?

2016-06-24 Thread Sayth Renshaw
On Friday, 24 June 2016 07:03:18 UTC+10, David Shi wrote: > Which one is the best XML-parser? > Can any one tell me? > Regards. > David Most would use lxml sayth -- https://mail.python.org/mailman/listinfo/python-list

Re: Which one is the best XML-parser?

2016-06-24 Thread Sayth Renshaw
On Friday, 24 June 2016 07:03:18 UTC+10, David Shi wrote: > Which one is the best XML-parser? > Can any one tell me? > Regards. > David Most use lxml Sayth -- https://mail.python.org/mailman/listinfo/python-list

Which one is the best XML-parser?

2016-06-24 Thread Sayth Renshaw
Lxml -- https://mail.python.org/mailman/listinfo/python-list

Re: Which one is the best XML-parser?

2016-06-24 Thread Peter Otten
t; pass > else: > inbuf = "" > try: > chunk += next(it) > except StopIteration: > break >

Re: Which one is the best XML-parser?

2016-06-24 Thread Marko Rauhamaa
pass else: inbuf = "" try: chunk += next(it) except StopIteration: break # trigger a decode error if chunk contains junk json.loads("[" + chunk) It could easily be converted to an analogous XML parser. Marko -- https://mail.python.org/mailman/listinfo/python-list

Re: Which one is the best XML-parser?

2016-06-24 Thread Random832
On Fri, Jun 24, 2016, at 02:39, dieter wrote: > You want an incremental parser if the XML documents are so huge that > you must process them incrementally rather than have a data structure > representing the whole document (in memory). Incremental parsers > for XML are usually called "SAX" parsers.

Re: Which one is the best XML-parser?

2016-06-23 Thread dieter
David Shi via Python-list writes: > Which one is the best XML-parser? "best" is not an absolute term but depends on criteria/conditions. There are essentially two kinds of parsers: incremental parsers which parse the structure and report events for everything they see and no

Which one is the best XML-parser?

2016-06-23 Thread David Shi via Python-list
Which one is the best XML-parser? Can any one tell me? Regards. David -- https://mail.python.org/mailman/listinfo/python-list

Re: XML parser: Element ordering?

2012-08-31 Thread Dave Angel
On 08/31/2012 08:21 AM, Stefan Behnel wrote: > Florian Lindner, 31.08.2012 14:03: >> I plan to use the etree.ElementTree XML parser to parse a config file >> in which the order of the elements matter, e.g.: >> >> >> >> >> >> is not equal to:

Re: XML parser: Element ordering?

2012-08-31 Thread Stefan Behnel
Florian Lindner, 31.08.2012 14:03: > I plan to use the etree.ElementTree XML parser to parse a config file > in which the order of the elements matter, e.g.: > > > > > > is not equal to: > > > > > > I have found different answers to the question

XML parser: Element ordering?

2012-08-31 Thread Florian Lindner
Hello, I plan to use the etree.ElementTree XML parser to parse a config file in which the order of the elements matter, e.g.: is not equal to: I have found different answers to the question if order matters in XML documents. So my question here: Does it matters (and is more or less

Re: Hi, Everyone: what's the most popular xml parser module on python?

2010-04-15 Thread Jo Chan
I want to say I just have to deal with some regular text input (the input file is as XML format) so I need to read all the nodes out and get what they are. Thanks for your great help though. I should have made my point clearer. :) On Thu, Apr 15, 2010 at 6:52 PM, Stefan Behnel wrote: > Jo Chan,

Re: Hi, Everyone: what's the most popular xml parser module on python?

2010-04-15 Thread Jo Chan
On Thu, Apr 15, 2010 at 6:52 PM, Stefan Behnel wrote: > Jo Chan, 15.04.2010 10:52: > > I just want to get the content from a XML. > > That's not a very specific description of what you want to do. What's "the > content"? The plain text content? Or do you care about the structure? And > what parts

Re: Hi, Everyone: what's the most popular xml parser module on python?

2010-04-15 Thread Stefan Behnel
Jo Chan, 15.04.2010 10:52: > I just want to get the content from a XML. That's not a very specific description of what you want to do. What's "the content"? The plain text content? Or do you care about the structure? And what parts of the structure? > I learn that there are two > modules in pyth

Re: Hi, Everyone: what's the most popular xml parser module on python?

2010-04-15 Thread Stefan Behnel
Shashwat Anand, 15.04.2010 12:29: On Thu, Apr 15, 2010 at 3:50 PM, Stefan Behnel wrote: Shashwat Anand, 15.04.2010 11:55: BeautifulSoup The OP asked for an XML parser. BeatifulSoup can be used as one IMO But it is not an XML parser according to the XML spec. So giving the impression

Re: Hi, Everyone: what's the most popular xml parser module on python?

2010-04-15 Thread Shashwat Anand
BeatifulSoup can be used as one IMO On Thu, Apr 15, 2010 at 3:50 PM, Stefan Behnel wrote: > Shashwat Anand, 15.04.2010 11:55: > > BeautifulSoup > > The OP asked for an XML parser. > > Stefan > > -- > http://mail.python.org/mailman/listinfo/python-list > -

Re: Hi, Everyone: what's the most popular xml parser module on python?

2010-04-15 Thread Stefan Behnel
Shashwat Anand, 15.04.2010 11:55: > BeautifulSoup The OP asked for an XML parser. Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: Hi, Everyone: what's the most popular xml parser module on python?

2010-04-15 Thread Shashwat Anand
BeautifulSoup On Thu, Apr 15, 2010 at 1:39 PM, Stefan Behnel wrote: > Jo Chan, 14.04.2010 15:28: > > Hi, everyone~~~ I am new. >> What is the most popular xml parser module used on python? Thanks for >> answering... >> > > Why do you want to know? Just out of

Re: Hi, Everyone: what's the most popular xml parser module on python?

2010-04-15 Thread Stefan Behnel
Jo Chan, 14.04.2010 15:28: Hi, everyone~~~ I am new. What is the most popular xml parser module used on python? Thanks for answering... Why do you want to know? Just out of curiosity, or are you looking for a tool that you can use to get a specific job done? If it's the latter, you may

Hi,Everyone: what's the most popular xml parser module on python?

2010-04-15 Thread Jo Chan
Hi, everyone~~~ I am new. What is the most popular xml parser module used on python? Thanks for answering... -- -- Best Regards 陈松坚 信息科学与技术学院 中山大学 广州大学城 510006 Chen Songjian School of Information Science & Technology Sun Yat-sen(Zhongshan) University, Guangzhou Higher Educa

Re: python profiling for a XML parser program

2009-09-28 Thread Stefan Behnel
MacRules wrote: > I have a python program doing XML data prasing and write the result to 2 > data files; which will be loaded to MySQL. > [...] > Is there a python profiler just like for C program? > And tell me which functions or modules take a long time. In case you want to do this because you n

Re: python profiling for a XML parser program

2009-09-19 Thread MacRules
Paul Boddie wrote: On 19 Sep, 21:19, MacRules wrote: Is there a python profiler just like for C program? And tell me which functions or modules take a long time. Can you show me URL or link on doing this task? Having already looked at combining Python profilers with KCachegrind (as suggested

Re: python profiling for a XML parser program

2009-09-19 Thread Paul Boddie
On 19 Sep, 21:19, MacRules wrote: > > Is there a python profiler just like for C program? > And tell me which functions or modules take a long time. > > Can you show me URL or link on doing this task? Having already looked at combining Python profilers with KCachegrind (as suggested by Andrew Dal

Re: python profiling for a XML parser program

2009-09-19 Thread Diez B. Roggisch
MacRules schrieb: I have a python program doing XML data prasing and write the result to 2 data files; which will be loaded to MySQL. I ran this. $ python dealmaker.py ... read data loop through records ... XML parsing ... write to file1.dat ... write to file2.date done Is there a python prof

python profiling for a XML parser program

2009-09-19 Thread MacRules
I have a python program doing XML data prasing and write the result to 2 data files; which will be loaded to MySQL. I ran this. $ python dealmaker.py ... read data loop through records ... XML parsing ... write to file1.dat ... write to file2.date done Is there a python profiler just like for

Re: XML parser

2008-10-20 Thread Diez B. Roggisch
RC wrote: > By default the > > document = xml.dom.minidom.parse(inputFileName.xml) > > This will convert all the & to & > But I want to convert the & back to & > > Is there a module or method in Python? > I know there is such method in PHP, but I am > new in Python. >>> from xml.sax import sax

XML parser

2008-10-20 Thread RC
By default the document = xml.dom.minidom.parse(inputFileName.xml) This will convert all the & to & But I want to convert the & back to & Is there a module or method in Python? I know there is such method in PHP, but I am new in Python. Thanks! -- http://mail.python.org/mailman/listinfo/python-

Re: Confused: looking for a simple XML parser

2008-08-16 Thread Kay Schluehr
On 16 Aug., 02:21, Rex <[EMAIL PROTECTED]> wrote: > Hello, > > I am a Python programmer facing my first small XML project. I am > looking to find a simple tool to take an XSD file and convert the XSD > tree structure to another text format (e.g. an adjacency matrix for > the tree's graph), or conve

Re: Confused: looking for a simple XML parser

2008-08-15 Thread Marek Kubica
Hi, On Fri, 15 Aug 2008 17:21:56 -0700, Rex wrote: > What tool should I use? For easy stuff ElementTree (bundled with Python 2.5 but also available to older versions), for more complex stuff lxml (which extends the ET API, so the learning curve is incremental). regards, Marek -- http://mail.p

Confused: looking for a simple XML parser

2008-08-15 Thread Rex
Hello, I am a Python programmer facing my first small XML project. I am looking to find a simple tool to take an XSD file and convert the XSD tree structure to another text format (e.g. an adjacency matrix for the tree's graph), or convert one xml file format definition into another, non-xml one.

Re: Python base distribution come with a validating XML parser?

2008-07-25 Thread R�diger Werner
> Hi, > > Basic XML questions, > > I have a .xml file I want to validate against a .xsd file... > > Does the Python base distribution come with a validating XML parser? > > I want to make sure the elements in my xml file vs. the elements > defined in my xsd are a mat

Python base distribution come with a validating XML parser?

2008-07-25 Thread goldtech
Hi, Basic XML questions, I have a .xml file I want to validate against a .xsd file... Does the Python base distribution come with a validating XML parser? I want to make sure the elements in my xml file vs. the elements defined in my xsd are a match. I could parse both XML and xsd elements to

Re: trying to use sax for a very basic first xml parser

2008-07-15 Thread manu
> > May I suggest you ask in the blender list? > Will do that and report back. Thank you! Manuel -- http://mail.python.org/mailman/listinfo/python-list

Re: trying to use sax for a very basic first xml parser

2008-07-14 Thread Miki
Hello, > Could it be that I have to install the same python version Blender was > compiled with? I have no idea. May I suggest you ask in the blender list? HTH, -- Miki <[EMAIL PROTECTED]> http://pythonwise.blogspot.com -- http://mail.python.org/mailman/listinfo/python-list

Re: trying to use sax for a very basic first xml parser

2008-07-14 Thread manu
On Jul 14, 8:14 pm, Miki <[EMAIL PROTECTED]> wrote: > Python is using an external library for SAX (expat IIRC). > I *guess* the Python that comes with Blender don't have this library. > I don't know... I didnt install any external libraries for sax. I think python comes with a standard sax librar

Re: trying to use sax for a very basic first xml parser

2008-07-14 Thread Miki
Hello, > but when I copy the script into blender and run it I get: > > [code]Compiled with Python version 2.5. > Checking for installed Python... got it! > Traceback (most recent call last): >   File "Text", line 27, in >   File "H:\Python25\lib\xml\sax\__init__.py", line 93, in make_parser >    

trying to use sax for a very basic first xml parser

2008-07-14 Thread manu
Hi, I need to parse xml files for the Blender Game Engine. ATM I am trying to get this script running in the BGE. This is my first script and I dont have much experience programming... import xml.sax class PnmlHandler(xml.sax.ContentHandler): def __init__(self): self.inPlace=0 d

help regarding xml parser modules

2008-03-11 Thread Vinay Aiya
Hello, Can any one help for error in following code. actually i want to map the element name with its data between start and end tag , but i am unable to do so. here is the code which i am trying for please do reply if i am not on right track. import xml.sax.handler class BookHandler(xml.sax.ha

RE: Xml parser

2007-05-27 Thread Eiwot
Let's try http://pyxml.sourceforge.net/ Cheers Python Articles at http://pyarticles.blogspot.com/> Date: Sat, 26 May 2007 10:02:06 +0200> From: [EMAIL PROTECTED]> Subject: Re: Xml parser> To: python-list@python.org> > XiaQ wrote:> > You can use DOM> > ht

Re: Xml parser

2007-05-26 Thread Stefan Behnel
XiaQ wrote: > You can use DOM > http://diveintopython.org/, Chapter 9 > "ashish" wrote >> Hi All, >> >> I want to know weather is there any api available in python for parsing >> xml(XML parser) >> >> Regards >> Ashish Sure, you can use

Re: Xml parser

2007-05-26 Thread XiaQ
You can use DOM http://diveintopython.org/, Chapter 9 "ashish" wrote > Hi All, > > I want to know weather is there any api available in python for parsing > xml(XML parser) > > Regards > Ashish > -- http://mail.python.org/mailman/listinfo/python-list

Re: Xml parser

2007-05-25 Thread kyosohma
On May 25, 7:04 am, "Amit Khemka" <[EMAIL PROTECTED]> wrote: > On 5/24/07, ashish <[EMAIL PROTECTED]> wrote: > > > Hi All, > > > I want to know weather is there any api available in python for parsing > > xml(XML parser) > > Checkout

Re: Xml parser

2007-05-25 Thread Amit Khemka
On 5/24/07, ashish <[EMAIL PROTECTED]> wrote: > Hi All, > > I want to know weather is there any api available in python for parsing > xml(XML parser) Checkout cElementTree . Cheers, -- Amit Khemka -- onyomo.com Home Page: www.cse.iitd.ernet.in/~csd00377 Endless the wor

Re: Xml parser

2007-05-25 Thread Max M
ashish skrev: > Hi All, > > I want to know weather is there any api available in python for parsing > xml(XML parser) I have had very good succes with lxml -- hilsen/regards Max M, Denmark http://www.mxm.dk/ IT's Mad Science -- http://mail.python.org/mailman/listinfo/python-list

Xml parser

2007-05-25 Thread ashish
Hi All, I want to know weather is there any api available in python for parsing xml(XML parser) Regards Ashish -- http://mail.python.org/mailman/listinfo/python-list

Re: Recommended validating XML parser?

2007-05-07 Thread Stefan Behnel
Kirk Strauser wrote: > We're looking for a current, supported, validating XML parser. Since it > seems like there are a few thousand out there, I though we'd see what > everyone else is using. You are asking for lxml, right? http://codespeak.net/lxml/ > Bonus points

Recommended validating XML parser?

2007-05-07 Thread Kirk Strauser
We're looking for a current, supported, validating XML parser. Since it seems like there are a few thousand out there, I though we'd see what everyone else is using. Bonus points if it can do something like: >>> foo = XMLParser("""

Re: Fast and capable XML parser?

2007-04-20 Thread Magnus Lycka
Larry Bates wrote: > I don't know if it meets ALL of your requirements but this might > help: > > http://www.reportlab.org/pyrxp.html AFAIK, there is no XML Schema support in PyRXP. This is really bad enough. GPL is not an option for us, and a commercial licence is less good than e.g. MIT or LGP

Re: Fast and capable XML parser?

2007-04-20 Thread Steven Bethard
Magnus Lycka wrote: > I'm looking for some library to parse XML code > much faster than the libs built into Python 2.4 > (I'm stuck with 2.4 for quite a while) and I > also need XML Schema validation, and would > appreciate support for e.g. XPath and XInclude. > I also want an API which is more Pyt

Re: Fast and capable XML parser?

2007-04-20 Thread Larry Bates
Magnus Lycka wrote: > I'm looking for some library to parse XML code > much faster than the libs built into Python 2.4 > (I'm stuck with 2.4 for quite a while) and I > also need XML Schema validation, and would > appreciate support for e.g. XPath and XInclude. > I also want an API which is more Pyt

Fast and capable XML parser?

2007-04-20 Thread Magnus Lycka
I'm looking for some library to parse XML code much faster than the libs built into Python 2.4 (I'm stuck with 2.4 for quite a while) and I also need XML Schema validation, and would appreciate support for e.g. XPath and XInclude. I also want an API which is more Pythonic than e.g. a thin wrapper o

Re: XML parser that sorts elements?

2006-09-28 Thread jmike
Paul McGuire wrote: > >>> doc.childNodes[0].childNodes = sorted( > ... [n for n in doc.childNodes[0].childNodes > ... if n.nodeType==doc.ELEMENT_NODE], > ... key=lambda n:n.nodeName) > >>> print doc.toprettyxml() > > > > goodbye > > >

Re: XML parser that sorts elements?

2006-09-22 Thread Paul McGuire
"Paul McGuire" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > This is what I posted, but it's not what I typed. I entered some very long lines at the console, and the newsgroup software, when wrapping the text, pre

Re: XML parser that sorts elements?

2006-09-22 Thread jmike
Paul McGuire wrote: ... > Here is a snippet from an interactive Python session, working with the > "batteries included" xml.dom.minidom. The solution is not necessarily in > the parser, it may be instead in what you do with the parsed document > object. > > This is not a solution to your actual

Re: XML parser that sorts elements?

2006-09-22 Thread Paul McGuire
<[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hi everyone, > > I am a total newbie to XML parsing. I've written a couple of toy > examples under the instruction of tutorials available on the web. > > The problem I want to solve is this. I have an XML snippet (in a > string) that

Re: XML parser that sorts elements?

2006-09-22 Thread jmike
Diez B. Roggisch wrote: > You can sort them by obtaining them as tree of nodes, e.g. using element > tree or minidom. > > But you should be aware that this will change the structure of your document > and it isn't always desirable to do so - e.g. html pages would look funny > to say the least if

Re: XML parser that sorts elements?

2006-09-22 Thread Diez B. Roggisch
[EMAIL PROTECTED] wrote: > Hi everyone, > > I am a total newbie to XML parsing. I've written a couple of toy > examples under the instruction of tutorials available on the web. > > The problem I want to solve is this. I have an XML snippet (in a > string) that looks like this: > > > hello

XML parser that sorts elements?

2006-09-22 Thread jmike
Hi everyone, I am a total newbie to XML parsing. I've written a couple of toy examples under the instruction of tutorials available on the web. The problem I want to solve is this. I have an XML snippet (in a string) that looks like this: hello goodbye and I want to alphabetize not only

Re: Question about XML Parser in Python.

2005-05-11 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: > Well, I'm fairly new to Python and have encountered a strange error while > reading an XML document in Python. I used the SAX parser, and my input XML is > fairly large with 30 records. I extract about 25 fields from each record > and spit out a csv file. The str

Question about XML Parser in Python.

2005-05-11 Thread Amitpython5
Hello,     Well, I'm fairly new to Python and have encountered a strange error while reading an XML document in Python. I used the SAX parser, and my input XML is fairly large with 30 records. I extract about 25 fields from each record and spit out a csv file. The strange thing is that af