[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
A debugging puzzle with XML
From: |
Marcin Borkowski |
Subject: |
A debugging puzzle with XML |
Date: |
Wed, 28 Jan 2015 18:33:52 +0100 |
Hi there,
as we all know, everything is better with XML, so here's a puzzle for
all interested (I call it a puzzle and not a bug because I finally
solved it).
Download the xmlgen library (https://github.com/philjackson/xmlgen) and
execute this code:
(require 'xmlgen)
(with-temp-file "foo.xml"
(insert (xmlgen '(hello (world (of (xml) "!")))))).
Visit file foo.xml, do this:
C-x h M-x sgml-pretty-print
and enjoy your beautifully formatted (and indented!) XML code.
Now rinse and repeat, but with one change:
(require 'xmlgen)
(with-temp-file "foo.xml"
(insert (xmlgen '(hello (world (of (xml) "!")))))
(sgml-pretty-print (point-min) (point-max)))
and answer this question: where have all the indents go?
;-D
Best,
--
Marcin Borkowski
http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski
Faculty of Mathematics and Computer Science
Adam Mickiewicz University
- A debugging puzzle with XML,
Marcin Borkowski <=