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:
>>
>>
>>
>>
>>
>> I have found different answers to
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 if order matters in XML
> documents. So my
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
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
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 DOM, but if you want to get real work done with XML, lxml is
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
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 cElementTree .
>
> Cheers,
>
> --
>
> Amit Khemka -- onyomo.
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 world's turn, endless th
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
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
>
>
>
"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
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
<[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
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
[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
15 matches
Mail list logo