Irmen de Jong wrote:
> On 30-1-2017 18:58, Chris Green wrote:
> > I want to parse some XML data, it's the address book data from the
> > linux program osmo. The file I want to parse is like this:-
> >
>
> [snip]
>
> >
> > I basically want to be able to extract the data and output in other
> >
On 01/30/2017 02:14 PM, Juan C. wrote:
On Mon, Jan 30, 2017 at 3:58 PM, Chris Green wrote:
I want to parse some XML data, it's the address book data from the
linux program osmo. The file I want to parse is like this:-
Just like Irmen said, use the default xml.etree.ElementTree, it's
amazing
On Mon, Jan 30, 2017 at 3:58 PM, Chris Green wrote:
> I want to parse some XML data, it's the address book data from the
> linux program osmo. The file I want to parse is like this:-
Just like Irmen said, use the default xml.etree.ElementTree, it's
amazing and very simple to use.
--
https://mai
On 30-1-2017 18:58, Chris Green wrote:
> I want to parse some XML data, it's the address book data from the
> linux program osmo. The file I want to parse is like this:-
>
[snip]
>
> I basically want to be able to extract the data and output in other
> formats - e.g. write to a Sqlite3 databas
I want to parse some XML data, it's the address book data from the
linux program osmo. The file I want to parse is like this:-
None
Peter and Denise
Smith
0
0
Some address
AAA BBB
Oxfo
On Wed, 28 Dec 2016 02:05 am, Skip Montanaro wrote:
> I am trying to parse some XML which doesn't specify an encoding (Python
> 2.7.12 via Anaconda on RH Linux), so it barfs when it encounters non-ASCII
> data. No great surprise there, but I'm having trouble getting it to use
> another encoding. F
Peter Otten wrote:
> works, but to go back to the bytes that the XML parser needs the
> "preferred encoding", in your case ASCII, will be used.
Correction: it's probably sys.getdefaultencoding() rather than
locale.getdefaultencoding(). So all systems with a sane configuration will
behave the sa
Skip Montanaro wrote:
> Peter> Isn't UTF-8 the default?
>
> Apparently not.
Sorry, I meant the default for XML.
> I believe in my reading it said that it used whatever
> locale.getpreferredencoding() returned. That's problematic when you
> live in a country that thinks ASCII is everything. Per
Peter> Isn't UTF-8 the default?
Apparently not. I believe in my reading it said that it used whatever
locale.getpreferredencoding() returned. That's problematic when you
live in a country that thinks ASCII is everything. Personally, I think
UTF-8 should be the default, but that train's long left t
Skip Montanaro wrote:
> I am trying to parse some XML which doesn't specify an encoding (Python
> 2.7.12 via Anaconda on RH Linux), so it barfs when it encounters non-ASCII
> data. No great surprise there, but I'm having trouble getting it to use
> another encoding. First, I tried specifying the e
I am trying to parse some XML which doesn't specify an encoding (Python 2.7.12
via Anaconda on RH Linux), so it barfs when it encounters non-ASCII data. No
great surprise there, but I'm having trouble getting it to use another
encoding. First, I tried specifying the encoding when opening the fil
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-
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--L41_NBR3349_1
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
I'm attempting to parse an RSS feed for the first instance of an element "".
def pageReader(url):
try:
readPage = urllib2.urlopen(url)
except urllib2.URLError, e:
# print 'We failed to reach a server.'
# print 'Reason: ', e.reason
return 404
except urllib2.HTTPError, e:
# print('
In article ,
Stefan Behnel wrote:
>Christian Heimes, 10.08.2010 01:39:
>> Am 10.08.2010 01:20, schrieb Aahz:
>>> The docs say, "Parses an XML section into an element tree incrementally".
>>> Sure sounds like it retains the entire parsed tree in RAM. Not good.
>>> Again, how do you parse an XML f
Christian Heimes, 10.08.2010 01:39:
Am 10.08.2010 01:20, schrieb Aahz:
The docs say, "Parses an XML section into an element tree incrementally".
Sure sounds like it retains the entire parsed tree in RAM. Not good.
Again, how do you parse an XML file larger than your available memory
using somet
Am 10.08.2010 01:20, schrieb Aahz:
> The docs say, "Parses an XML section into an element tree incrementally".
> Sure sounds like it retains the entire parsed tree in RAM. Not good.
> Again, how do you parse an XML file larger than your available memory
> using something other than SAX?
The docum
In article ,
Stefan Behnel wrote:
>Aahz, 09.08.2010 18:52:
>> In article,
>> Stefan Behnel wrote:
>>>
>>> First of all: don't use SAX. Use ElementTree's iterparse() function. That
>>> will shrink you code down to a simple loop in a few lines.
>>
>> Unless I'm missing something, that only helps if
Aahz, 09.08.2010 18:52:
In article,
Stefan Behnel wrote:
First of all: don't use SAX. Use ElementTree's iterparse() function. That
will shrink you code down to a simple loop in a few lines.
Unless I'm missing something, that only helps if the final tree fits into
memory. What do you suggest
In article ,
Stefan Behnel wrote:
>
>First of all: don't use SAX. Use ElementTree's iterparse() function. That
>will shrink you code down to a simple loop in a few lines.
Unless I'm missing something, that only helps if the final tree fits into
memory. What do you suggest other than SAX if you
jia li, 28.07.2010 12:10:
I have an XML file with hundreds of elements.
What's strange is only one of there elements could not be parsed correctly:
REVERSE_INULL
Dispose_ParameterList
Dispose_ParameterList
UNINSPECTED
146
1/146MMSLib_LinkedList.c
I printed the data in "characters(self, data)
I have an XML file with hundreds of elements.
What's strange is only one of there elements could not be parsed correctly:
REVERSE_INULL
Dispose_ParameterList
Dispose_ParameterList
UNINSPECTED
146
1/146MMSLib_LinkedList.c
I printed the data in "characters(self, data)" and after parsing. The res
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
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
--
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
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) While I am finally comfortable with the XML
description
phasma wrote:
> xml.parsers.expat.ExpatError: not well-formed (invalid token): line
> 538676, column 17
Looks like your XML file is broken in line 538676.
> try:
> handler = open(args[0], "r")
This should read
handler = open(args[0], "rb")
Maybe t
Hi.
I'm trying to disassemble bzipped file. If I use minidom.parseString,
I'm getting this error:
Traceback (most recent call last):
File "./replications.py", line 342, in ?
File "/usr/lib64/python2.4/xml/dom/minidom.py", line 1925, in
parseString
return expatbuilder.parseString(string)
On Jan 29, 9:29 pm, abhishek <[EMAIL PROTECTED]> wrote:
> Hello group,
>
> I am having problem parsing following data set from XML. Please
> provide hints on how to rectify this problem.
You have provided no hints on what your problem is. What output do you
want? What have you tried? What output a
On Jan 29, 4:46 am, Stefan Behnel <[EMAIL PROTECTED]> wrote:
>
> How is this related to XML?
>
> Stefan
I guess that's what makes so **nasty**!
-- Paul
--
http://mail.python.org/mailman/listinfo/python-list
abhishek wrote:
> I am having problem parsing following data set from XML. Please
> provide hints on how to rectify this problem.
>
> I am using python2.4 version
>
> this is te test data that i am using --
>
> """
> 1!!!11
> 2@@@22
> 3###33
> 4$$$
Hello group,
I am having problem parsing following data set from XML. Please
provide hints on how to rectify this problem.
I am using python2.4 version
this is te test data that i am using --
"""
1!!!11
2@@@22
3###33
4$$$44
5%%%5
[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
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
from xml.sax.handler import ContentHandler
from xml
Thanks, I have tried all you told me. It was an error on print statement. So
I decided to catch the exception if I had an UnicodeEncodeError, that is, if
I had chinese/japanese characters because they don't interest to me and it
worked.
The strip_asian function of Ryan didn't work well here, but it
On 10/23/07, Stefan Behnel <[EMAIL PROTECTED]> wrote:
> Fabian López wrote:
> > Thanks Mark, the code is like this. The attrib name is the problem:
> >
> > from lxml import etree
> >
> > context = etree.iterparse("file.xml")
> > for action, elem in context:
> > if elem.tag == "weblog":
> >
On 10/23/07, Fabian López <[EMAIL PROTECTED]> wrote:
> Hi,
> I am parsing an XML file that includes chineses characters, like
> ^�u�u啖啖才是�w.���扉L锍才是�� or ヘアアイロン... The problem is that I get an error like:
> UnicodeEncodeerror:'charmap' codec can't encode characters in position
> The thing is th
Fabian López wrote:
> Thanks Mark, the code is like this. The attrib name is the problem:
>
> from lxml import etree
>
> context = etree.iterparse("file.xml")
> for action, elem in context:
> if elem.tag == "weblog":
> print action, elem.tag , elem.attrib["name"],elem.attrib["url"],
> On Behalf Of Fabian Lopez
> like ^�u�u啖啖才是�w.���扉L锍才是�� or ヘアアイロン... The problem is that
I get
Just thought I'd point out here that the second string is Japanese, not
Chinese.
>From your second post, it appears that you've parsed the text without
problems -- it's when you go to print them out
Thanks Mark, the code is like this. The attrib name is the problem:
from lxml import etree
context = etree.iterparse("file.xml")
for action, elem in context:
if elem.tag == "weblog":
print action, elem.tag , elem.attrib["name"],elem.attrib["url"],
elem.attrib["rssUrl"]
And the xml fi
On Mon, 22 Oct 2007 21:24:40 +0200, Fabian López wrote:
> I am parsing an XML file that includes chineses characters, like ^
> uu啖啖才是w.扉L锍才是 or ヘアアイロン... The problem is that I get an error like:
> UnicodeEncodeerror:'charmap' codec can't encode characters in
> position..
You say you are *parsing*
Hi,
I am parsing an XML file that includes chineses characters, like ^
�u�u啖啖才是�w.���扉L锍才是�� or ヘアアイロン... The problem is that I get an error like:
UnicodeEncodeerror:'charmap' codec can't encode characters in position
The thing is that I would like to ignore it and parse all the characters
less
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 info
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
(this question was also posted in the devshed python forum:
http://forums.devshed.com/python-programming-11/parsing-xml-with-elementtree-unicode-problem-461518.html
).
-
(it's a bit longish but I hope I give all the information)
1. here is my problem: I'm
On Feb 17, 6:55 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
> I'm trying to parse out some XML nodes with namespaces using
> BeautifulSoup. I can't seem to get the syntax correct. It doesn't like
> the colon in the tag name, and I'm not sure how to refer to that tag.
>
> I'm trying to get th
I'm trying to parse out some XML nodes with namespaces using
BeautifulSoup. I can't seem to get the syntax correct. It doesn't like
the colon in the tag name, and I'm not sure how to refer to that tag.
I'm trying to get the attributes of this tag:
The only way I've been able to get it is by doi
Prakash
Subject: Re: [Jython-users] ERROR : parsing xml in jython
Hi,
looks like you have to make an InputSource from the file, like so:
from java.io import File, FileReader, StringReader
textReader = FileReader(File(filename))
inputSource = InputSource(textReader)
dp.parse(inputSource)
Hope this
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):
>
Hi, Currently I m writing an XML parser that processes an xml file using sax, and I have it working, however I want to make the code of my parser less cluttered and more readable by other people (including myself). However it is quite messy at the moment. The main reason is that Python doesnt have
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
Hello,
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?
A guide I saw mentioned importing xml.xslt, however it appears the xml
module/pack
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
I have a XML scheme (xsd) from which I have created with xjc (a java
binding compiler (JAXB)) my java objects with all the get and set
methods. Now I have to use this scheme and do the same in python but I
can't find a tool which can read the scheme. I already tried
generateDS.py but it couldn't p
> > I have found that some people refuse to stick to standards, so whenever I
> > parse XML files I remove any characters that fall in the range
> > <= 0x1f
> >
> >>= 0xf0
>
> Now of what help shall that be? Get rid of all accented characters?
> Sorry, but that surely is the dumbest thing to do he
> I have found that some people refuse to stick to standards, so whenever I
> parse XML files I remove any characters that fall in the range
> <= 0x1f
>
>>= 0xf0
Now of what help shall that be? Get rid of all accented characters?
Sorry, but that surely is the dumbest thing to do here - and has
Odd-R. wrote:
> This is retrieved through a webservice and stored in a variable test
>
>
>
>
> ]>
> æøå
>
> printing this out yields no problems, so the trouble seems to be when
> executing
> the following:
>
> doc = minidom.parseString(test)
You need to do
doc = minidom.parseString(test.e
Odd-R. wrote:
> This is retrieved through a webservice and stored in a variable test
>
>
>
>
> ]>
> æøå
>
> printing this out yields no problems, so the trouble seems to be when
> executing
< the following:
>
> doc = minidom.parseString(test)
unless we have a cut-and-paste problem here, that
On 2005-09-05, Fredrik Lundh <[EMAIL PROTECTED]> wrote:
> Odd-R. wrote:
>
>> I use xml.dom.minidom to parse some xml, but when input
>< contains some specific caracters(æ, ø and å), I get an
>> UnicodeEncodeError, like this:
>>
>> UnicodeEncodeError: 'ascii' codec can't encode character
>> u'\xe6'
>> I use xml.dom.minidom to parse some xml, but when input
>> contains some specific caracters(æ, ø and å), I get an
>> UnicodeEncodeError, like this:
>>
>> UnicodeEncodeError: 'ascii' codec can't encode character
>> u'\xe6' in position 604: ordinal not in range(128).
>>
>> How can I avoid this err
if you're getting this on the way in, something is broken (posting a short
self-contained test program will help us figure out what's wrong).
Or he tries to pass a unicode object to parseString.
Regards,
Diez
# -*- coding: utf-8 -*-
import xml.dom.minidom
dom3 = xml.dom.minidom.parseString(
Odd-R. wrote:
> I use xml.dom.minidom to parse some xml, but when input
< contains some specific caracters(æ, ø and å), I get an
> UnicodeEncodeError, like this:
>
> UnicodeEncodeError: 'ascii' codec can't encode character
> u'\xe6' in position 604: ordinal not in range(128).
>
> How can I avoid t
I use xml.dom.minidom to parse some xml, but when input
contains some specific caracters(æ, ø and å), I get an
UnicodeEncodeError, like this:
UnicodeEncodeError: 'ascii' codec can't encode character
u'\xe6' in position 604: ordinal not in range(128).
How can I avoid this error?
All help much ap
"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
1 - 100 of 102 matches
Mail list logo