On Tuesday, December 2, 2014 11:52:37 PM UTC+1, John Gordon wrote:
> In Uzoma Ojemeni
> writes:
>
> > I am new to Python - a few days old - and I would appreciate some help.
>
> > I want write a python code to parse the below XML as below:-
>
> > ServingCell--NeighbourCell
> > L41_NBR
Uzoma Ojemeni writes:
...
One easy option would be to use the "XPath" support in the "lxml"
package -- provided you have not problem with the installation
of external libraries ("libxml2" and "libxslt") and C-extensions ("lxml").
--
https://mail.python.org/mailman/listinfo/python-list
In Uzoma Ojemeni
writes:
> I am new to Python - a few days old - and I would appreciate some help.
> I want write a python code to parse the below XML as below:-
> ServingCell--NeighbourCell
> L41_NBR3347_1--L41_NBR3347_2
> L41_NBR3347_1--L41_NBR3347_3
> L41_NBR3347_1-
On Thursday 2013 February 07 12:36, darrel.rend...@gmail.com wrote:
> As I've said, BeautifulSoup fails to find both pubDate and Link, which are
> crucial to my app
> Any advice would be greatly appreciated.
http://packages.python.org/feedparser
--
Yonder nor sorghum stenches shut ladle gulls st
In <16828a11-6c7c-4ab6-b406-6b8819883...@googlegroups.com>
darrel.rend...@gmail.com writes:
> def pageReader(url):
> try:
> readPage =3D urllib2.urlopen(url)
> except urllib2.URLError, e:
> # print 'We failed to reach a server.'
> # print 'Reason: ', e.reason
> return 404 =20
> except
On May 16, 10:52 am, Stefan Behnel wrote:
> Jake b, 16.05.2010 09:40:
>
> > Check out Amara:http://www.xml3k.org/Amara/QuickRef
>
> > It looks promising. For a pythonic solution over sax / dom.
>
> > >>> Iter(doc.team.player)
> > # or
> > >>> doc.team.player[0].name
>
> Ah, right, and there's also
Jake b, 16.05.2010 09:40:
Check out Amara: http://www.xml3k.org/Amara/QuickRef
It looks promising. For a pythonic solution over sax / dom.
>>> Iter(doc.team.player)
# or
>>> doc.team.player[0].name
Ah, right, and there's also lxml.objectify:
from lxml.objectify import parse
root = p
2010 17:20:57 -0700 (PDT)
> In-Reply-To: <4beec709$0$18653$4fafb...@reader3.news.tin.it>
> References:
>
> <4beec709$0$18653$4fafb...@reader3.news.tin.it>
> Date: Sat, 15 May 2010 19:20:57 -0500
> Message-ID:
> Subject: Re: parsing XML
> From: Jake b
On May 14, 7:57 am, "kak...@gmail.com" wrote:
> Hi to all, let's say we have the following Xml
>
>
> 17.1
> 6.4
>
>
> 15.5
> 7.8
>
>
>
> How can i get the players name, age and height?
> DOM or SAX and how
>
> Thanks
> Antonis
I've found some code which converts an X
superpollo ha scritto:
kak...@gmail.com ha scritto:
Hi to all, let's say we have the following Xml
17.1
6.4
15.5
7.8
How can i get the players name, age and height?
DOM or SAX and how
Thanks
Antonis
another minimal xml.etree.ElementTree solution:
>>> print doc
kak...@gmail.com ha scritto:
Hi to all, let's say we have the following Xml
17.1
6.4
15.5
7.8
How can i get the players name, age and height?
DOM or SAX and how
Thanks
Antonis
another minimal xml.etree.ElementTree solution:
>>> print document
17.1
6.
In message , Stefan
Behnel wrote:
> Here's an overly complicated solution, but I thought that an object
> oriented design would help here.
How many times are you going to write the “"name", "age", "height"”
sequence? The next assignment question I would ask is: how easy would it be
to add a fo
>>> Hi to all, let's say we have the following Xml
>>>
>>>
>>> 17.1
>>> 6.4
>>>
>>>
>>> 15.5
>>> 7.8
>>>
>>>
>>>
>>> How can i get the players name, age and height?
>>> DOM or SAX and how
>>
>> Homework?
>
> I would hope that every school teacher who teaches P
On Fri, 2010-05-14 at 22:17 +0200, Stefan Behnel wrote:
> >>
> >>
> >> 17.1
> >> 6.4
> >>
> >>
> >> 15.5
> >> 7.8
> >>
> >>
from lxml import etree
handle = open('file', 'rb')
doc = etree.parse(handle)
handle.close()
players = [ ]
for player in doc.xpath('/tea
Martin v. Loewis, 14.05.2010 17:15:
kak...@gmail.com wrote:
Hi to all, let's say we have the following Xml
17.1
6.4
15.5
7.8
How can i get the players name, age and height?
DOM or SAX and how
Homework?
I would hope that every school teacher who teaches
On May 14, 6:22 pm, Stefan Behnel wrote:
> kak...@gmail.com, 14.05.2010 16:57:
>
> > Hi to all, let's say we have the following Xml
> >
> >
> > 17.1
> > 6.4
> >
> >
> > 15.5
> > 7.8
> >
> >
>
> > How can i get the players name, age and height?
>
> Here's an ov
kak...@gmail.com, 14.05.2010 16:57:
Hi to all, let's say we have the following Xml
17.1
6.4
15.5
7.8
How can i get the players name, age and height?
Here's an overly complicated solution, but I thought that an object
oriented design would help here.
kak...@gmail.com wrote:
> Hi to all, let's say we have the following Xml
>
>
> 17.1
> 6.4
>
>
> 15.5
> 7.8
>
>
>
> How can i get the players name, age and height?
> DOM or SAX and how
Homework?
Martin
--
http://mail.python.org/mailman/listinfo/python-list
Chris Rebert wrote:
> On Fri, Jan 23, 2009 at 11:19 AM, aha wrote:
>> I've been charged with developing an XML configuration file format,
>> for one of the applications that my company develops.
>> [...]
>> I am still trying to determine the
>> best XML parser API to use. I would love to use XPAT
On Fri, Jan 23, 2009 at 11:19 AM, aha wrote:
> Hello All,
> I've been charged with developing an XML configuration file format,
> for one of the applications that my company develops. (Yes, I know it
> would have been easier to just use the configuration file format as
> described in RFC 822) W
[EMAIL PROTECTED] wrote:
> I am a newbie in python
> I am trying to parse a xml file and write its content in a txt file.
If you want to write code that does not hide your bugs behind cryptic event
handlers and instead helps you get XML work done, try using ElementTree or
lxml instead of SAX. The
On Tue, Oct 30, 2007 at 11:45:17AM -0700, [EMAIL PROTECTED] wrote regarding Re:
Parsing xml file in python:
Top-posting corrected
>
>
>
> On Oct 30, 12:32 pm, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote:
> > [EMAIL PROTECTED] schrieb:
> >
> >
On Tue, 30 Oct 2007 11:45:17 -0700, amjadcsu wrote:
> I am not getting into the xml parser.
What does this mean!?
> The error is not generated but also the /root/yhpc-2.0/ganglia.txt does
> not contain anything.
Maybe because…
>> > def endElement(self,name):
>> > if name=="HOST" an
That XML is just a snapshot
I am not getting into the xml parser. The error is not generated but
also the /root/yhpc-2.0/ganglia.txt does not contain anything.
On Oct 30, 12:32 pm, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote:
> [EMAIL PROTECTED] schrieb:
>
>
>
> > I am a newbie in python
> > I
[EMAIL PROTECTED] schrieb:
> I am a newbie in python
> I am trying to parse a xml file and write its content in a txt file.
> The txt contains null elements. Any reason what iam doing wrong here
>
>
> Here is the code that i wrote
>
> import sys,os
> import xml.sax
> import xml.sax.handler
> fr
On Jul 26, 4:34 pm, Stefan Behnel <[EMAIL PROTECTED]> wrote:
> [EMAIL PROTECTED] wrote:
> > On Jul 26, 3:13 pm, John Machin <[EMAIL PROTECTED]> wrote:
> >> On Jul 26, 9:24 pm, [EMAIL PROTECTED] wrote:
>
> >>> OK, I solved the problem but I still don't get what went wrong.
> >>> Solution - use tree
[EMAIL PROTECTED] wrote:
> On Jul 26, 3:13 pm, John Machin <[EMAIL PROTECTED]> wrote:
>> On Jul 26, 9:24 pm, [EMAIL PROTECTED] wrote:
>>
>>> OK, I solved the problem but I still don't get what went wrong.
>>> Solution - use tree builder in order to create the new xml file
>>> (previously I was "ma
On Jul 26, 3:13 pm, John Machin <[EMAIL PROTECTED]> wrote:
> On Jul 26, 9:24 pm, [EMAIL PROTECTED] wrote:
>
> > OK, I solved the problem but I still don't get what went wrong.
> > Solution - use tree builder in order to create the new xml file
> > (previously I was "manually" creating it).
>
> > I
On Jul 26, 9:24 pm, [EMAIL PROTECTED] wrote:
> OK, I solved the problem but I still don't get what went wrong.
> Solution - use tree builder in order to create the new xml file
> (previously I was "manually" creating it).
>
> I'm still curious so I'm adding a link to a short and very simple
> scri
OK, I solved the problem but I still don't get what went wrong.
Solution - use tree builder in order to create the new xml file
(previously I was "manually" creating it).
I'm still curious so I'm adding a link to a short and very simple
script that gets an xml (containing non ascii chars) from th
[EMAIL PROTECTED] wrote:
>> How about trying
>> root = ElementTree.parse(urlopen(query), encoding ='utf-8')
That doesn't work.
> this specific thing is not working, however, parsing the url is not
> problematic.
So you tried parsing the complete XML file and it works? Then it's the way you
stri
> How about trying
> root = ElementTree.parse(urlopen(query), encoding ='utf-8')
>
this specific thing is not working, however, parsing the url is not
problematic. the problem is that after parsing the xml at the url I
save some of the fields to a local file and the local file is not
being parsed
On Jul 23, 11:29 am, [EMAIL PROTECTED] wrote:
> (this question was also posted in the devshed python
> forum:http://forums.devshed.com/python-programming-11/parsing-xml-with-elem...
> ).
> -
>
> (it's a bit longish but I hope I give all the information)
>
> 1. here is m
Marc 'BlackJack' Rintsch wrote:
> On Tue, 24 Jul 2007 05:57:26 +, oren.tsur wrote:
>
>> but the thing is that the parser parses it all right from the web (the
>> amazon response) but fails to parse the locally saved file.
>
> I've just used wget to fetch that URL and `ElementTree` parses that
On Tue, 24 Jul 2007 05:57:26 +, oren.tsur wrote:
> but the thing is that the parser parses it all right from the web (the
> amazon response) but fails to parse the locally saved file.
I've just used wget to fetch that URL and `ElementTree` parses that local
file without problems.
Maybe you s
[EMAIL PROTECTED] wrote:
> On Jul 23, 4:46 pm, "Richard Brodie" <[EMAIL PROTECTED]> wrote:
>> <[EMAIL PROTECTED]> wrote in message
>>
>> news:[EMAIL PROTECTED]
>>
>>> so what's the difference? how comes parsing is fine
>>> in the first case but erroneous in the second case?
>> You may have guessed
On Jul 23, 4:46 pm, "Richard Brodie" <[EMAIL PROTECTED]> wrote:
> <[EMAIL PROTECTED]> wrote in message
>
> news:[EMAIL PROTECTED]
>
> > so what's the difference? how comes parsing is fine
> > in the first case but erroneous in the second case?
>
> You may have guessed the encoding wrong. It probabl
<[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> so what's the difference? how comes parsing is fine
> in the first case but erroneous in the second case?
You may have guessed the encoding wrong. It probably
wasn't utf-8 to start with but iso8859-1 or similar.
What actual byte valu
Nathan Harmston wrote:
> However it is quite messy at the moment. The main reason is that Python
> doesnt have a switch statement.
a switch statement wouldn't save you a single line, so I find it a bit hard
to believe that it's the main reason...
> def startElement(self,name,attributes):
>
veracon wrote:
> I'm looking to use XML and XSLT for templates in a system I'm writing,
> however I'm not really sure which parser is the "best". Basically,
> which library has the most features, and which is the most supported?
lxml arguably has the most features by now, as it is based on libxml2
veracon wrote:
>
> I'm looking to use XML and XSLT for templates in a system I'm writing,
> however I'm not really sure which parser is the "best". Basically,
> which library has the most features, and which is the most supported?
I use (my own) libxml2dom [1] and XSLTools [2] to respectively pars
Yes, documents should also be validated against the schema. I finally
managed to compile my schema with generateDS.py but I haven't tested
the result because of my poor knowledge of Python. So I have to wait
until the group does which wanted to use my schema.
Thanks for your answer!
Matthias
--
You don't just want to parse the XSD data because there lots of XML
parsers for Python. You want to validate documents against the schema,
right? I haven't yet seen a good XML schema validator for Python.
libxml2 has good bindings for validating XML against RelaxNG schemas.
- C
Bizarro-02 wr
"rh0dium" wrote:
> Ok so up to here I am ok. I find ( If you want the full xml let me
> know) two blocks of system memory. It MUST be "System Memory" only.
> Now how do I get a list of all of the children "nodes" of this. They
> are named bank:N ( i.e bank:0, bank:1 etc [see below] ). For eac
Fredrik Lundh wrote:
> didn't you ask the same question a few days ago? did you read the
> replies to that post?
Yes I did but the XML was malformed.. Actually it still is but you
helped me figure out a way to correct it - Thanks
Here is what I have so far. Now I want to find a child of a chi
"rh0dium" wrote:
> I am relatively new to python and certainly new to XML parsing. Can
> some show me how to get the product text out of this?
didn't you ask the same question a few days ago? did you read the
replies to that post?
assuming that your sample is correct, you need to process the a
Hi
rh0dium wrote:
> I am relatively new to python and certainly new to XML parsing.
Me too. However there are plenty of good docs/tutorials available to
help with both XML and using it in Python.
For XML you may wish to look at http://www.w3schools.com/. It has a very
accessible set of tutor
47 matches
Mail list logo