473,396 Members | 2,013 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Re: Using the indent method

dj
Hello All,

I am using elementtree to write an XML document and I am having a hard
time adding the correct indentation.
I have tried using the indent method, but I can not figure out how to
use it. Any suggestions.
Jun 27 '08 #1
1 864

"dj" <d.***********@gmail.comwrote in message
news:ff**********************************@f63g2000 hsf.googlegroups.com...
Hello All,

I am using elementtree to write an XML document and I am having a hard
time adding the correct indentation.
I have tried using the indent method, but I can not figure out how to
use it. Any suggestions.
Using the version of indent() found on
http://effbot.org/zone/element-lib.htm:
>>from xml.etree import ElementTree as ET
x='<a><b /><c /><d>stuff</d><e><f /></e></a>'
e=ET.fromstring(x)
ET.dump(e)
<a><b /><c /><d>stuff</d><e><f /></e></a>
>>indent(e)
ET.dump(e)
<a>
<b />
<c />
<d>stuff</d>
<e>
<f />
</e>
</a>

-Mark

Jun 27 '08 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: vishal | last post by:
hi i am using get method to pass data from one form to another and my value may contain & symbol. so when this is case the value after & sign is truncated which is logically true. so what...
6
by: Keith | last post by:
Is there a way to publish only one file in VS.NET 2003 using FPSE method? In FP client I can select one file at a time to publish. My web is large and it takes too long to publish the whole...
8
by: aruna | last post by:
to write a c program to find the roots of the equation using bisection method that too using array or pointers
4
by: Velhari | last post by:
Hi all, We all know in GET method upto 2048 characters can be appended into URL. In the Same way what is the limit of sending data to server by using POST Method. Why asking this question...
2
by: =?Utf-8?B?am9obmFicmFoYW0xMDE=?= | last post by:
hello, I'm trying to write a some text to a text file using WriteAllText method. This method works fine but I don't understand how can I use format specifiers to format the text as we use in C i.e...
0
by: 2pt2mill | last post by:
I have been using SharpZipLib for over a year with no problems, but it doesn't support files zipped using compression method 6 (Imploding). This seems to be an older method of compression utilized...
5
by: JohnDriver | last post by:
Hi, I am having a form which has a text box and 3 radio buttons. I am using GET method in Ajax to pass the value. I can pass the value of the textbox fine but how to pass the value of radio...
0
by: DKn | last post by:
Hi, I am doing shutdown for a remote system using this method InvokeMethod("Win32Shutdown", inParams, null); in C#.Net 2.0. Once the shutdown is done, how to get the status , whether the...
2
by: Rakulkumar | last post by:
how can i print the pdf file using binarywrite method in asp.i can print the text file using Response.binarywrite method but i cnat print the pdf files
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.