2)
http://stackoverflow.com/questions/7802418/how-to-properly-escape-single-and-double-quotes
3)http://stackoverflow.com/questions/4972210/escaping-characters-in-a-xml-file-with-python
Here is the data (in CSV format) and script, respectively, (I
have tried v
h-python
>>
>>
>> Here is the data (in CSV format) and script, respectively, (I have tried
>> variations on serializing Column 'E' using both Sax and ElementTree):
>>
>> i)
>>
>> A,B,C,D,E,F,G,H,I,J
>> "3","8"
stions/7802418/how-to-properly-escape-single-and-double-quotes
>>
>> 3)
>> http://stackoverflow.com/questions/4972210/escaping-characters-in-a-xml-file-with-python
>>
>>
>> Here is the data (in CSV format) and script, respectively, (I have tried
>> varia
-quotes
3)http://stackoverflow.com/questions/4972210/escaping-characters-in-a-xml-file-with-python
Here is the data (in CSV format) and script, respectively, (I have tried
variations on serializing Column 'E' using both Sax and ElementTree):
i)
A,B,C,D,E,F,G,H,I,J
"3","8
-quotes
3)http://stackoverflow.com/questions/4972210/escaping-characters-in-a-xml-file-with-python
Here is the data (in CSV format) and script, respectively, (I have tried
variations on serializing Column 'E' using both Sax and ElementTree):
i)
A,B,C,D,E,F,G,H,I,J
"3","8
/questions/4972210/escaping-characters-in-a-xml-file-with-python
Here is the data (in CSV format) and script, respectively, (I have tried
variations on serializing Column 'E' using both Sax and ElementTree):
i)
A,B,C,D,E,F,G,H,I,J
"3","8","1","2312285SC
within XML documents
> is the XPath query language. ElementTree has limited support for it
> https://docs.python.org/3/library/xml.etree.elementtree.html#elementtree-xpath>,
> enough for your stated requirements.
>
>> I would like to use ElementTree to get 2 values from this:
>
>>
>>
>> KA21
>> KA21
>>
>>
>>
>>
>>
>>
>>
>>
>>00:00:00
&
pointlessly force you to use mixed case, when the convention
is to name all the elements in lowercase (‘parameter’, ‘current’, etc.).
That said: What you need for this kind of searching within XML documents
is the XPath query language. ElementTree has limited support for it
https://docs.python.or
KA21
> KA21
>
>
>
>
>
>
>
>
>00:00:00
>15/03/2014 05:56:00
>
>
>
>
>
>
> I would like to use ElementTree to get 2 values from this:
>
> SystemConfig.Environment
:00
I would like to use ElementTree to get 2 values from this:
SystemConfig.Environment.ToolName.Current
Events.LastEventExportTime.Current
I've been trying for hours to get ElementTree to give me these 2
values, but nothing I do seems to work. Can anyone help me
graeme.piete...@gmail.com, 24.02.2014 10:45:
> I am building HTML pages using ElementTree.
> I need to insert chunks of untrusted HTML into the page. I do not need or
> want to parse this, just insert it at a particular point as is.
How would you want to find out if it can be safely in
I am building HTML pages using ElementTree.
I need to insert chunks of untrusted HTML into the page. I do not need or want
to parse this, just insert it at a particular point as is.
The best solutions I can think of are rather ugly ones: manipulating the string
created by tostring.
Is there a
I'm tasked with writing a 'simple' ElementTree based parser with support for
unknown entities eg &foo;.
This code derived from FL's old documentation fails in both python 2 and 3.
import xml.etree.ElementTree as ET
try:
ascii
except:
fro
On Tue, Nov 26, 2013 at 8:20 AM, Stefan Behnel wrote:
> Larry Martell, 26.11.2013 13:23:
>> On Tue, Nov 26, 2013 at 2:38 AM, Stefan Behnel wrote:
>>> larry.martell...@gmail.com, 25.11.2013 23:22:
I have an XML file that has an element called "Node". These can be nested
to any depth and
e, if the XML file had:
>
>
>
>
>
>
>
> When I'm parsing Node "E" I need to know I'm in A/B/C/D/E.
> Problem is I don't know how deep this can be. This is the code
> I have so far:
I also an ElementTree user, but it&
Larry Martell, 26.11.2013 13:23:
> On Tue, Nov 26, 2013 at 2:38 AM, Stefan Behnel wrote:
>> larry.martell...@gmail.com, 25.11.2013 23:22:
>>> I have an XML file that has an element called "Node". These can be nested
>>> to any depth and the depth of the nesting is not known to me. I need to
>>> p
On 26/11/13 11:59, Larry Martell wrote:
On Tue, Nov 26, 2013 at 5:41 AM, Alister wrote:
On Mon, 25 Nov 2013 18:25:55 -0500, Larry Martell wrote:
On Mon, Nov 25, 2013 at 6:19 PM, Chris Angelico
wrote:
On Tue, Nov 26, 2013 at 9:45 AM, Larry Martell
wrote:
On Monday, November 25, 2013 5:30:
append() at the beginning of the function
> and pop() at the end, i.e. a stack. That list will then always give you the
> current path from the root node.
Thanks for the reply. How can I remove getiterator()? Then I won't be
traversing the nodes of the tree. I can't iterate over tree.
On Tue, Nov 26, 2013 at 10:59 PM, Larry Martell wrote:
> Sorry, didn't realize it was sending in HMTL. I had it set to plain
> text, but when the awful gmail update came out it seems to have
> reverted to HTML. Hopefully this is better.
Yeah, I have the same trouble... but yes, this post looks fi
On Tue, Nov 26, 2013 at 5:41 AM, Alister wrote:
>
> On Mon, 25 Nov 2013 18:25:55 -0500, Larry Martell wrote:
>
> > On Mon, Nov 25, 2013 at 6:19 PM, Chris Angelico
> > wrote:
> >
> >> On Tue, Nov 26, 2013 at 9:45 AM, Larry Martell
> >>
> >> wrote:
> >> > On Monday, November 25, 2013 5:30:44 PM UT
On Mon, 25 Nov 2013 18:25:55 -0500, Larry Martell wrote:
> On Mon, Nov 25, 2013 at 6:19 PM, Chris Angelico
> wrote:
>
>> On Tue, Nov 26, 2013 at 9:45 AM, Larry Martell
>>
>> wrote:
>> > On Monday, November 25, 2013 5:30:44 PM UTC-5, Chris Angelico wrote:
>> >
>> >> First off, please clarify: Ar
mply pass down a
list of element names that you append() at the beginning of the function
and pop() at the end, i.e. a stack. That list will then always give you the
current path from the root node.
Alternatively, if you want to use lxml.etree instead of ElementTree, you
can use it's iterwal
On Mon, Nov 25, 2013 at 6:19 PM, Chris Angelico wrote:
> On Tue, Nov 26, 2013 at 9:45 AM, Larry Martell
> wrote:
> > On Monday, November 25, 2013 5:30:44 PM UTC-5, Chris Angelico wrote:
> >
> >> First off, please clarify: Are there five corresponding tags
> >> later on? If not, it's not XML, an
On Tue, Nov 26, 2013 at 9:45 AM, Larry Martell wrote:
> On Monday, November 25, 2013 5:30:44 PM UTC-5, Chris Angelico wrote:
>
>> First off, please clarify: Are there five corresponding tags
>> later on? If not, it's not XML, and nesting will have to be defined
>> some other way.
>
> Yes, there a
On Monday, November 25, 2013 5:30:44 PM UTC-5, Chris Angelico wrote:
> On Tue, Nov 26, 2013 at 9:22 AM, larry.mart...@gmail.com
>
> wrote:
>
> > I have an XML file that has an element called "Node". These can be nested
> > to any depth and the depth of the nesting is not known to me. I need to
On Tue, Nov 26, 2013 at 9:22 AM, larry.mart...@gmail.com
wrote:
> I have an XML file that has an element called "Node". These can be nested to
> any depth and the depth of the nesting is not known to me. I need to parse
> the file and preserve the nesting. For exmaple, if the XML file had:
>
>
I have an XML file that has an element called "Node". These can be nested to
any depth and the depth of the nesting is not known to me. I need to parse the
file and preserve the nesting. For exmaple, if the XML file had:
When I'm parsing Node "E" I need to know I
ank you all!
>
>
>
> I was a little apprehensive it could be a silly mistake. And so it was.
>
> I have BeautifulSoup somewhere. Having had no urgent need for it I
>
> remember shirking the learning curve.
>
>
>
> lxml seems to be a package with the
On 07/11/2013 10:59 AM, F.R. wrote:
Hi all,
I haven't been able to get up to speed with XML. I do examples from
the tutorials and experiment with variations. Time and time again I
fail with errors messages I can't make sense of. Here's the latest
one. The url is "http://finance.yahoo.com/q?s=
On 11 Jul 2013 10:24, wrote:
>
> Actually, I don't think etree has a HTML parser. And I would
counter-recommend lxml if speed is an issue: BeautifulSoup takes a long
time to parse a large document.
>
> On Thursday, July 11, 2013 5:08:04 PM UTC+8, Fábio Santos wrote:
> >
> > Use an HTML parser.
Actually, I don't think etree has a HTML parser. And I would counter-recommend
lxml if speed is an issue: BeautifulSoup takes a long time to parse a large
document.
On Thursday, July 11, 2013 5:08:04 PM UTC+8, Fábio Santos wrote:
> On 11 Jul 2013 10:04, "F.R." wrote:
>
> >
>
> > Hi all,
>
On 11 Jul 2013 10:04, "F.R." wrote:
>
> Hi all,
>
> I haven't been able to get up to speed with XML. I do examples from the
tutorials and experiment with variations. Time and time again I fail with
errors messages I can't make sense of. Here's the latest one. The url is "
http://finance.yahoo.com/
Hi all,
I haven't been able to get up to speed with XML. I do examples from the
tutorials and experiment with variations. Time and time again I fail
with errors messages I can't make sense of. Here's the latest one. The
url is "http://finance.yahoo.com/q?s=XIDEQ&ql=0";. Ubuntu 12.04 LTS,
Pyth
Hi list,
This may be of interest - a program to create simple PDF books from XML text
content:
Create PDF books with XMLtoPDFBook:
http://jugad2.blogspot.in/2013/06/create-pdf-books-with-xmltopdfbook.html
XMLtoPDFBook.py requires ElementTree (which is in the standard Python library),
xtopdf
nenad.ci...@gmail.com, 12.12.2012 03:19:
> Il giorno martedì 11 dicembre 2012 20:59:54 UTC+1, MRAB ha scritto:
>>
>>> Since I have also the need to sign the XML I need the ability to create xml
>>> but without xml escaping (unescaped data are signed).
>>
>> XML with the escaping isn't valid XML.
>
. Xml is not too difficult so I thought to create
> > it manually using ElementTree.
>
> > First I noted that ET.toString does escape <>& but not " and '
>
> > Is that normal?
>
> >
>
> " needs to be encoded when it's in an
On 2012-12-11 17:47, nenad.ci...@gmail.com wrote:
Hello, I have posted the same in XML group but it seems pretty dead there so I
will repost here.
I am new to xml processing in python.
I am looking to create XML. Xml is not too difficult so I thought to create it
manually using ElementTree
Hello, I have posted the same in XML group but it seems pretty dead there so I
will repost here.
I am new to xml processing in python.
I am looking to create XML. Xml is not too difficult so I thought to create it
manually using ElementTree.
First I noted that ET.toString does escape <>
Alain Ketterlin, 17.10.2012 08:25:
> It looks like you can't get the parent of an Element with elementtree (I
> would love to be proven wrong on this).
No, that's by design. ElementTree allows you to reuse subtrees in a
document, for example, which wouldn't work if you enf
Tharanga Abeyseela writes:
> I need to remove the parent node, if a particular match found.
It looks like you can't get the parent of an Element with elementtree (I
would love to be proven wrong on this).
The solution is to find all nodes that have a Rating (grand-) child, and
t
Hi,
note that it's best to reply to responses you get, rather than starting a
new thread on the same topic. It helps in building up context and in
keeping details together at one point in the archive for users who run into
similar problems later.
Tharanga Abeyseela, 17.10.2012 07:47:
> I need to
Sophie Sperner, 07.01.2012 13:01:
> On Jan 7, 11:53 am, Stefan Behnel wrote:
>> A big issue that I have with Jython is that its ElementTree XML parser
>> support is so increadibly slow. It could seriously benefit from a better
>> integration between the Java XML support i
Ethan Furman writes:
> In the near future I will need to parse and rewrite parts of a xml files
> created by a third-party program (PrintShopMail, for the curious).
> It contains both binary and textual data.
>
> There has been some strong debate about the merits of minidom v
about the merits of minidom vs
ElementTree.
Recommendations?
People's reaction to the DOM interface seem quite varied, with a majority,
perhaps, being negative. I personally would look at both enough to
understand the basic API model to see where *I* fit.
The API is one thing, yes, but there
ElementTree.
Recommendations?
People's reaction to the DOM interface seem quite varied, with a
majority, perhaps, being negative. I personally would look at both
enough to understand the basic API model to see where *I* fit.
--
Terry Jan Reedy
--
http://mail.python.org/mailman/listinfo/p
In the near future I will need to parse and rewrite parts of a xml files
created by a third-party program (PrintShopMail, for the curious).
It contains both binary and textual data.
There has been some strong debate about the merits of minidom vs
ElementTree.
Recommendations?
~Ethan~
--
http
suppress this?
>
> See http://effbot.org/zone/element-namespaces.htm
>
> I'm not sure you can define the default namespace (i.e., avoid prefixes
> on element names). However, any conformant XML processor should have no
> problem with the output of ElementTree.
Sorry,
s.htm
I'm not sure you can define the default namespace (i.e., avoid prefixes
on element names). However, any conformant XML processor should have no
problem with the output of ElementTree.
If you're actually producing HTML, then you should say so when calling
tostring(), by giving the app
When reading a tree and writing it back to a new file all the elements are
prepended with the string ns0:
Why is it prepended and how can I suppress this?
Thanks,
Alex van der Spek
--
http://mail.python.org/mailman/listinfo/python-list
hello,
On Thu, Apr 28, 2011 at 07:57:28AM +0200, Stefan Behnel wrote:
> >So, I started change the codepage mark of xml:
> >
> > - same result
> > - same result
> > - same result
>
> You probably changed this in an editor that supports XML and thus
> saves the file in the declared encoding.
no
Hegedüs Ervin, 27.04.2011 21:33:
hello,
I'm using ElementTree to parse an XML file, but it stops at the
second record (id = 002), which contains a non-standard ascii
character, ä. Here's the XML:
The complaint offered up by the parser is
I've checked this xml with
On 4/27/2011 12:24 PM, Neil Cerutti wrote:
On 2011-04-27, Mike wrote:
I'm using ElementTree to parse an XML file, but it stops at the
second record (id = 002), which contains a non-standard ascii
character, ?. Here's the XML:
The complaint offered up by the parser is
On 4/27/2011 12:33 PM, Hegedüs Ervin wrote:
hello,
I'm using ElementTree to parse an XML file, but it stops at the
second record (id = 002), which contains a non-standard ascii
character, ä. Here's the XML:
The complaint offered up by the parser is
I've checked thi
hello,
> I'm using ElementTree to parse an XML file, but it stops at the
> second record (id = 002), which contains a non-standard ascii
> character, ä. Here's the XML:
>
>
>
>
>
>
>
>
>
>
> The complaint offered up by the parser is
On Apr 27, 2011, at 2:26 PM, Mike wrote:
> I'm using ElementTree to parse an XML file, but it stops at the second record
> (id = 002), which contains a non-standard ascii character, ä. Here's the XML:
>
>
>
>
>
>
>
>
>
>
> The comp
On 2011-04-27, Mike wrote:
> I'm using ElementTree to parse an XML file, but it stops at the
> second record (id = 002), which contains a non-standard ascii
> character, ?. Here's the XML:
>
>
>
>
>
>
>
>
>
>
> The complaint offered up by the pa
On Wed, Apr 27, 2011 at 2:26 PM, Mike wrote:
> I'm using ElementTree to parse an XML file, but it stops at the second
> record (id = 002), which contains a non-standard ascii character, ä. Here's
> the XML:
>
>
>
>
>
>
>
>
>
>
> The
I'm using ElementTree to parse an XML file, but it stops at the second
record (id = 002), which contains a non-standard ascii character, ä.
Here's the XML:
The complaint offered up by the parser is
Unexpected error opening simple_fail.xml: not well-formed (invalid
toke
I have to parse many xml documents that senselessly(?) specify a
single namespace for the whole document. After a couple of years,
my approach has boiled down to the following three little
helpers, for use with ElementTree:
def insert_namespace(xpath):
# Enable *simple* xpath searches by
hackingKK writes:
> On Sunday 31 October 2010 01:58 PM, Lawrence D'Oliveiro wrote:
>> In message, hackingKK
>> wrote:
>>
>>
>>> I want to know if there is a way to have the ElementTree module write to
>>> an xml file with line breaks?
hackingKK, 31.10.2010 10:04:
On Sunday 31 October 2010 01:58 PM, Lawrence D'Oliveiro wrote:
hackingKK wrote:
Further more, I just was curious why elementtree is not having the
namespace facility?
ElementTree handles namespaces just fine.
So is there a function to generate tags
On Sunday 31 October 2010 01:58 PM, Lawrence D'Oliveiro wrote:
In message, hackingKK
wrote:
I want to know if there is a way to have the ElementTree module write to
an xml file with line breaks?
Why does it matter? The XML files you generate are not for humans to look
at, are
In message , hackingKK
wrote:
> I want to know if there is a way to have the ElementTree module write to
> an xml file with line breaks?
Why does it matter? The XML files you generate are not for humans to look
at, are they?
> Further more, I just was curious why elementtree is not h
Hello all.
I want to know if there is a way to have the ElementTree module write to
an xml file with line breaks?
I find that when I use the write function from the module on a tree
object, the resulting file has no line breaks. I don't want to use
prittyprint because it is adding extra
did not quite like about dom.minidom, so now
> trying to use elementTree.
> But to my surprise, I could not import xml.elementtree in my default python
> 2.6 setup.
The module is called xml.etree.ElementTree, *not* xml.elementtree.
It's been in Python since v2.5.
Cheers,
Chris
--
h
do the following
import xml.etree
that imports the elementtree library in 2.5 it self so you sure can do that
in 2.6
http://docs.python.org/library/xml.etree.elementtree.html
--
Thanks & Regards,
Godson Gera
Python Consultant
India<http://blog.godson.in/2010/09/how-to-make-python-xm
Hello all,
Some days back I had asked a few questions about parsing xml files using
python.
I have tryed dom.minidom module but I did not like the prittyPrint way
of writing nodes.
There were many other things I did not quite like about dom.minidom, so
now trying to use elementTree.
But to my
en this should help:
>>
>> >> from xml.etree.ElementTree import *
>>
>> >> doc = """
>> >>
>> >>
>> >> httpRequest
>> >> HTTP://cmd.wma.ibm.com:80/
>> >> GET
>> >>
t; >>
> >> httpRequest
> >> HTTP://cmd.wma.ibm.com:80/
> >> GET
> >> 200
> >>
> >>
> >> """
>
> >> doc = fromstring(doc)
>
> >> resource_access = doc.find("res
gt;> Then this should help:
>>
>> from xml.etree.ElementTree import *
>>
>> doc = """
>>
>>
>> httpRequest
>> HTTP://cmd.wma.ibm.com:80/
>> GET
>> 200
>>
>>
>> """
&
httpRequest
> HTTP://cmd.wma.ibm.com:80/
> GET
> 200
>
>
> """
>
> doc = fromstring(doc)
>
> resource_access = doc.find("resource_access")
> print tostring(resource_access)
>
> Diez
Diez,
This is the sample forma
tekion writes:
> All,
> I have the following xml tag:
>
>
> httpRequest
> HTTP://cmd.wma.ibm.com:80/
> GET
> 200
>
>
>
> I am interested in:
>httpRequest
> HTTP://cmd.wma.ibm.com:80/
> GET
> 200
> as well as the upper layer tag. How do I ge
All,
I have the following xml tag:
httpRequest
HTTP://cmd.wma.ibm.com:80/
GET
200
I am interested in:
httpRequest
HTTP://cmd.wma.ibm.com:80/
GET
200
as well as the upper layer tag. How do I get at the nest tag listed
above? Thanks.
--
http:
I can't use getroot() when using fromstring() -- as fromstring()
returns an Element, not an ElementTree object.
Yes, my root is the 'components' element, but find() seems to insist on
searching for sub-elements.
Ideally, I would like root.find('components') or
root.fin
Brendan Simon (eTRIX), 31.08.2010 10:49:
I am trying to use ElementTree (with Python 2.7) and can't seem to find
elements at the top level. The find() and findall() methods seem to
find elements within the top level, but not if it the elements are at
the top level.
How do I find top
m trying to use ElementTree (with Python 2.7) and can't seem to find
> elements at the top level. The find() and findall() methods seem to find
> elements within the top level, but not if it the elements are at the top
> level.
>
> How do I find top level elemen
I am trying to use ElementTree (with Python 2.7) and can't seem to find
elements at the top level. The find() and findall() methods seem to
find elements within the top level, but not if it the elements are at
the top level.
How do I find top level elements ??
Here is my code.
i
On Aug 12, 10:47 am, Peter Otten <__pete...@web.de> wrote:
> Doug wrote:
> > I'm using elementtree to create a form.
>
> > I would like to set the "selected" attribute.
>
> > Setting using the usual
> > option.set( "selected" =
Doug wrote:
> I'm using elementtree to create a form.
>
> I would like to set the "selected" attribute.
>
> Setting using the usual
> option.set( "selected" = "" )
Maybe that should be option.set(selected="selected"). I th
I'm using elementtree to create a form.
I would like to set the "selected" attribute.
Setting using the usual
option.set( "selected" = "" )
gives me
Operations
how does one make
Operations
which is what I need.
--
http://mail.python.org/mailman/listinfo/python-list
On 8/11/2010 12:21 PM, Pinku Surana wrote:
I checked the svn repo at effbot.org, but it appears to have no
updates since 2007. Has development moved elsewhere?
It is now in the stdlib (19.11) as xml.etree.ElementTree
http://svn.python.org/view/python/branches/py3k/Modules/_elementtree.c?revisio
I checked the svn repo at effbot.org, but it appears to have no
updates since 2007. Has development moved elsewhere?
Thanks.
--
http://mail.python.org/mailman/listinfo/python-list
Roland Hedberg, 30.07.2010 15:21:
I have the following XML snippet:
http://www.w3.org/2001/XMLSchema-instance";
xmlns:fed="http://docs.oasis-open.org/wsfed/federation/200706";
xsi:type="fed:SecurityTokenServiceType">
This part after parsing
nks wrote:
>>
>>> My general feeling is that ElementTree is a lot handier for reading
>>> and writing your own XML formats, than for handling XML files produced
>>> by other tools.
>>
>> Why is that? I’ve successfully used it to parse SVG files produced by
>
> "Lawrence" == Lawrence D'Oliveiro
> writes:
Lawrence> In message
Lawrence> ,
Lawrence> Roland
Lawrence> Hedberg wrote:
> And there is the problem, I've lost the coupling between the prefix
>> 'fed' and the namespace
>> "http://docs.oasis-open.org/wsfed/federati
On Aug 1, 5:43 pm, Lawrence D'Oliveiro wrote:
> In message
> <96e47fd8-c939-48a2-9a2b-92afa720c...@k1g2000prl.googlegroups.com>, Carl
>
> Banks wrote:
> > My general feeling is that ElementTree is a lot handier for reading
> > and writing your own XML formats, t
In message
<96e47fd8-c939-48a2-9a2b-92afa720c...@k1g2000prl.googlegroups.com>, Carl
Banks wrote:
> My general feeling is that ElementTree is a lot handier for reading
> and writing your own XML formats, than for handling XML files produced
> by other tools.
Why is that? I’ve su
TokenServiceType">
>
>
>
> This part after parsing with Elementtree gives me an Element instance
> with the following properties:
>
> > tree.tag
>
> {urn:oasis:names:tc:SAML:2.0:metadata}RoleDescriptor> tree.keys()
>
> ['{http://w
In message , Roland
Hedberg wrote:
> And there is the problem, I've lost the coupling between the prefix
> 'fed' and the namespace
> "http://docs.oasis-open.org/wsfed/federation/200706";.
Why is this a problem?
--
http://mail.python.org/mailman/listinfo/python-list
Hi!
I have the following XML snippet:
http://www.w3.org/2001/XMLSchema-instance";
xmlns:fed="http://docs.oasis-open.org/wsfed/federation/200706";
xsi:type="fed:SecurityTokenServiceType">
This part after parsing with Elementtree gives me an Element
It worked.
Thanks,
Abhijeet
On Fri, Jul 9, 2010 at 4:03 PM, John Krukoff wrote:
> On Fri, 2010-07-09 at 15:46 -0700, abhijeet thatte wrote:
> > Hi,
> >
> >
> > Does any one know how to use pretty printing with ElementTree while
> > generating xml files.
>
On Fri, 2010-07-09 at 15:46 -0700, abhijeet thatte wrote:
> Hi,
>
>
> Does any one know how to use pretty printing with ElementTree while
> generating xml files.
> We can use that with lxml. But I want to stick with it ElementTree.
>
>
> Thanks,
> Abhijeet
Hi,
Does any one know how to use pretty printing with ElementTree while
generating xml files.
We can use that with lxml. But I want to stick with it ElementTree.
Thanks,
Abhijeet
--
http://mail.python.org/mailman/listinfo/python-list
Thanks Robert Kern :
"prettyprint" ; indent() does the trick ;-)
>ElementTree writes exactly what you tell it to. In XML, whitespace is
>significant. If you want newlines and/or indentation to make it pretty-looking,
>then you need to add those to your elements.
>
>Fr
On Thu, May 27, 2010 at 9:13 PM, Robert Kern wrote:
> ElementTree writes exactly what you tell it to. In XML, whitespace is
> significant. If you want newlines and/or indentation to make it
> pretty-looking, then you need to add those to your elements.
This is not always true. Let me
On 5/27/10 7:52 PM, robert somerville wrote:
Hi I am using Ubuntu 9.10 and Python 2.6.4 ..
when I create an ElementTree object and the write it out using:
xml.etree.ElementTree.write() , I get one single long single line
files, instead of something that looks reasonable , what gives ??? (and
Hi I am using Ubuntu 9.10 and Python 2.6.4 ..
when I create an ElementTree object and the write it out using:
xml.etree.ElementTree.write() , I get one single long single line files,
instead of something that looks reasonable , what gives ??? (and is it
important ??)
eg: I get :
OneTwo
On Mar 10, 2010, at 6:48 PM, robert somerville wrote:
Hi ;
I installed the elementtree and celementree packages throught the
synaptic
package manager, all seems to go fine through the install ...
when i startup python and try to import them (as per the EFFBOTT.org
suggestions) .. PROBLEMS
Hi ;
I installed the elementtree and celementree packages throught the synaptic
package manager, all seems to go fine through the install ...
when i startup python and try to import them (as per the EFFBOTT.org
suggestions) .. PROBLEMS ... (see below ..) What am i doing wrong ??? this
is a new
1 - 100 of 585 matches
Mail list logo