473,320 Members | 1,832 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,320 software developers and data experts.

XML pretty printer

Hello,
Most XML examples have the content neatly laid out with newlines and
indenting. A DOM parser, however, does not bother with such niceties when
creating an XML file.
Is there a "pretty printer" function somewhere that makes XML easier to
read by adding the indenting?

--
jmm dash list (at) sohnen-moe (dot) com
(Remove .AXSPAMGN for email)
Jul 20 '05 #1
4 6286
In article <Fr********************@giganews.com>,
jmm-list-gn <jm***************@sohnen-moe.com> wrote:

% Is there a "pretty printer" function somewhere that makes XML easier to
% read by adding the indenting?

xmllint from the libxml distribution has a --format option which might
do what you want. http://xmlsoft.org

--

Patrick TJ McPhee
East York Canada
pt**@interlog.com
Jul 20 '05 #2

"jmm-list-gn" <jm***************@sohnen-moe.com> wrote in message
news:Fr********************@giganews.com...
Hello,
Most XML examples have the content neatly laid out with newlines and
indenting. A DOM parser, however, does not bother with such niceties when
creating an XML file.
Is there a "pretty printer" function somewhere that makes XML easier to
read by adding the indenting?

--
jmm dash list (at) sohnen-moe (dot) com
(Remove .AXSPAMGN for email)


Not sure how you are reading the XML.
Most browsers will render XML all pretty like you want. The XML itself
doesn't care about the formatting so it's really up to the viewer you use. A
simple text editor will not do what you want as I'm sure you've found.
Here's a similar discussion
http://tinyurl.com/68zkg
OTOH you could use XSLT to transform your XML to the format you want....
Jul 20 '05 #3

"Patrick TJ McPhee" <pt**@interlog.com> wrote in message
news:2p************@uni-berlin.de...
In article <Fr********************@giganews.com>,
jmm-list-gn <jm***************@sohnen-moe.com> wrote:

% Is there a "pretty printer" function somewhere that makes XML easier to % read by adding the indenting?

xmllint from the libxml distribution has a --format option which might
do what you want. http://xmlsoft.org

--

Thanks Patrick I didn't know about that, looks cool
http://xmlsoft.org/xmllint.html
Jul 20 '05 #4
Patrick TJ McPhee wrote:

% Is there a "pretty printer" function somewhere that makes XML easier to
% read by adding the indenting?

xmllint from the libxml distribution has a --format option which might
do what you want. http://xmlsoft.org

Yes, that is exactly it. Thank you!

--
jmm dash list (at) sohnen-moe (dot) com
(Remove .AXSPAMGN for email)
Jul 20 '05 #5

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

Similar topics

4
by: Guenther Schmidt | last post by:
Hi, is it possible to have PHP pretty print the HTML output? Günther
2
by: Patrick Herb | last post by:
Hello, I'm trying to print the content of a RichTextBox from my VB 6 app. What I want is that the CommonDialog shows up, the user selects a printer and the content of the RichTextBox prints to...
2
by: Jody Burgess | last post by:
Hi; I am writing my first python program and would like to know how to change stdout to refer to my default printer or any other printer on my network. The other question is, Is there an API set...
0
by: mhhohn | last post by:
Hi, is there a Python (or C) implementation of a box-based pretty printer as described in Derek Oppen's 1980 paper? -- Mike
0
by: James Griffiths | last post by:
Here is a report I've written about a printing problem that is being experienced by a particular company for whom I had developed a A97 system. After upgrading to Win XP and AXP, some printing...
6
by: John Wood | last post by:
Does anyone know of a good, free C# pretty-printer? One that outputs to HTML would be good. If it came with C# source it would be even better.
1
by: Karthic | last post by:
When i right click on the .rpt file in the VS 2003, i see a property printer setting. It says "No printer" on the top and there is option to select printer and paper settings etc.. I want to...
2
by: cjreynolds | last post by:
Please excuse my cluelessness on the subject - this is the first time I've worked with printing in VB (and it may be the last) and the more I work with it, the more confused I become... First, I'm...
9
by: id10t error | last post by:
Hello, I am going to be using a Symbol WT4090 to scan items. I need to printer a tag from the Zebra ql320 plus. I am trying to do this is Visual basic 2005. Does anyone know and good site to...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.