On 2011-02-07 18:46:17 -0500, Josh English said:
I found the code posted at
http://infix.se/2007/02/06/gentlemen-indent-your-xml
quite helpful in turning my xml into human-readable structures. It works
best for XML-Data.
lxml, which the code is using, already has a pretty_print feature
acc
Josh English wrote:
I found the code posted at
http://infix.se/2007/02/06/gentlemen-indent-your-xml
quite helpful in turning my xml into human-readable structures. It works
best for XML-Data.
Josh
It's done in one line with
http://docs.python.org/library/xml.dom.minidom.html#xml.dom.mini
-list@python.org
CC: python-list@python.org
Asunto: Re: Remove whitespaces and line breaks in a XML file
I found the code posted at
http://infix.se/2007/02/06/gentlemen-indent-your-xml
quite helpful in turning my xml into human-readable structures. It works
best for XML-Data.
Josh
--
http
I found the code posted at
http://infix.se/2007/02/06/gentlemen-indent-your-xml
quite helpful in turning my xml into human-readable structures. It works
best for XML-Data.
Josh
--
http://mail.python.org/mailman/listinfo/python-list
David Vicente, 07.02.2011 18:45:
I´m parsing an xml file with xml.etree. It works correctly, but I have a
problem with the text attribute of the elements which should be empty. For
example, in this case:
Ken
The text element of “book” should be empty, but it returns me so
Hi,
I´m parsing an xml file with xml.etree. It works correctly, but I have a
problem with the text attribute of the elements which should be empty. For
example, in this case:
Ken
The text element of book should be empty, but it returns me some
whitespaces and break li
On Fri, 21 Jan 2011 07:39:26 -0800, Oltmans wrote:
> Hi Python gurus, hope you're doing well. I've a small problem.
>
> When I run the following code
> ___
names = ['oltmans','abramhovic','\n','sal','lee'] print '| ' + ' |
'.join(names)
>
On 21/01/2011 16:25, Peter Otten wrote:
Oltmans wrote:
Hi Python gurus, hope you're doing well. I've a small problem.
When I run the following code
___
names = ['oltmans','abramhovic','\n','sal','lee']
print '| ' + ' | '.join(names)
| oltmans |
Oltmans wrote:
> Hi Python gurus, hope you're doing well. I've a small problem.
>
> When I run the following code
> ___
names = ['oltmans','abramhovic','\n','sal','lee']
print '| ' + ' | '.join(names)
> | oltmans | abramhovic |
> | sal |
Hi Python gurus, hope you're doing well. I've a small problem.
When I run the following code
___
>>> names = ['oltmans','abramhovic','\n','sal','lee']
>>> print '| ' + ' | '.join(names)
| oltmans | abramhovic |
| sal | lee
__
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 with namespac
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
On Saturday 11 September 2010, it occurred to Lawrence D'Oliveiro to exclaim:
> In message , MRAB
>
> wrote:
> > On 08/09/2010 19:07, Georg Brandl wrote:
> >> Thus spake the Lord: Thou shalt indent with four spaces. No more, no
> >> less. Four shall be the number of spaces thou shalt indent, and t
In message , MRAB
wrote:
> On 08/09/2010 19:07, Georg Brandl wrote:
>
>> Thus spake the Lord: Thou shalt indent with four spaces. No more, no
>> less. Four shall be the number of spaces thou shalt indent, and the
>> number of thy indenting shall be four. Eight shalt thou not indent,
>> nor either
On 09/09/2010 17:07, Mark Lawrence wrote:
On 08/09/2010 20:30, MRAB wrote:
On 08/09/2010 19:07, Georg Brandl wrote:
Thus spake the Lord: Thou shalt indent with four spaces. No more, no
less. Four shall be the number of spaces thou shalt indent, and the
number of thy indenting shall be four. Eig
On 08/09/2010 20:30, MRAB wrote:
On 08/09/2010 19:07, Georg Brandl wrote:
Thus spake the Lord: Thou shalt indent with four spaces. No more, no
less. Four shall be the number of spaces thou shalt indent, and the
number of thy indenting shall be four. Eight shalt thou not indent,
nor either indent
On 08/09/2010 19:07, Georg Brandl wrote:
Thus spake the Lord: Thou shalt indent with four spaces. No more, no
less. Four shall be the number of spaces thou shalt indent, and the
number of thy indenting shall be four. Eight shalt thou not indent,
nor either indent thou two, excepting that thou the
at are you doing with msg, and *exactly* what
is your evidence that line breaks are being ignored. With that
information, perhaps we can identify and solve the real problem
you're having.
First, it does in fact ignore all line breaks, not just double line
breaks.
Here's
D'Arcy J.M. Cain wrote:
On Mon, 23 Nov 2009 14:46:23 -0500
Susan Day wrote:
First, it does in fact ignore all line breaks, not just double line breaks.
Here's what I'm doing:
session.sendmail(clientEmail, ourEmail2, header+msg)
The email sent out has the message sans break
On Mon, 23 Nov 2009 14:46:23 -0500
Susan Day wrote:
> First, it does in fact ignore all line breaks, not just double line breaks.
> Here's what I'm doing:
> session.sendmail(clientEmail, ourEmail2, header+msg)
> The email sent out has the message sans breaks.
You should
On Mon, Nov 23, 2009 at 2:26 PM, Gary Herron wrote:
> >>> print 'A Message From %s:\n\n %s' % ('someone','some message')
> A Message From someone:
>
> some message
>
>
> So... *Exactly* what are you doing with msg, and *exactly* what
Susan Day wrote:
Hi;
I have the following line of code I'm sending to postfix:
msg = 'A Message From %s:\n\n %s' % (string.replace(customer, '_', '
'), msg)
Unfortunately, it ignores the line breaks. I also tried %0A but that
was ignored also. Please a
On Mon, Nov 23, 2009 at 10:45 AM, Susan Day wrote:
> Hi;
> I have the following line of code I'm sending to postfix:
>
> msg = 'A Message From %s:\n\n %s' % (string.replace(customer, '_', ' '),
> msg)
>
> Unfortunately, it ignores the l
Hi;
I have the following line of code I'm sending to postfix:
msg = 'A Message From %s:\n\n %s' % (string.replace(customer, '_', ' '),
msg)
Unfortunately, it ignores the line breaks. I also tried %0A but that was
ignored also. Please advise.
TIA,
Suzie
Hi Arnaud,
Great. Thanks for your help!
On Tue, Mar 11, 2008 at 10:27 AM, Arnaud Delobelle
<[EMAIL PROTECTED]> wrote:
>
> On Mar 10, 11:31 pm, js <[EMAIL PROTECTED]> wrote:
> > Hi list,
> >
> > Can I make TextWrapper keep line breaks in the text?
> >
On Mar 10, 11:31 pm, js <[EMAIL PROTECTED]> wrote:
> Hi list,
>
> Can I make TextWrapper keep line breaks in the text?
>
> For example,
>
> >>> s = "spam\nham"
> >>> print wrap(s)
>
> spam
> ham
>
> As far as I can tell, th
Hi list,
Can I make TextWrapper keep line breaks in the text?
For example,
>>> s = "spam\nham"
>>> print wrap(s)
spam
ham
As far as I can tell, there seems no way to do this,
but before writing my own solution, I want to know whether
the solution already exis
30 matches
Mail list logo