XML Tree Scoreboard
Rank Username Score
1 primo 1000 (47 B)
2 leonid 1000 (47 B)
3 Wim 979 (48 B)
4 JWvdVeer 979 (48 B)
5 rekotiira 979 (48 B)
6 ToastyX 979 (48 B)
7 ralf 979 (48 B)
8 six 959 (49 B)
9 Electron 959 (49 B)
10 lheurt 940 (50 B)
11 sl1m 940 (50 B)
12 iWinkLeon 922 (51 B)
13 nubs 887 (53 B)
14 Cyrion 825 (57 B)
15 Steinigtmich 701 (67 B)
16 eremit 681 (69 B)
17 henrik 671 (70 B)
18 ptnplanet 653 (72 B)
19 garas 644 (73 B)
20 runekg 635 (74 B)
Recent Activity
Username Bytes Time ago Result
wechselbalg 214 October 10 2014, 12:46:27
wechselbalg 271 October 10 2014, 12:28:26
kcmastrpc 174 December 06 2013, 23:34:06
kcmastrpc 117 December 06 2013, 23:14:35
nubs 53 July 31 2013, 14:40:22
artisk82 188 March 09 2013, 00:48:37
artisk82 349 March 09 2013, 00:24:06
artisk82 349 March 09 2013, 00:23:50
artisk82 357 March 09 2013, 00:22:09
artisk82 21 March 08 2013, 23:55:09
artisk82 378 March 08 2013, 23:52:14
artisk82 360 March 08 2013, 23:49:37
artisk82 360 March 08 2013, 23:47:15
artisk82 350 March 08 2013, 23:40:58
vird 100 March 04 2013, 16:23:04

Challenge: XML Tree

Challenge information

Challenge Type Private
Challenge Status Open
Constant name XML
Trim method Full trim
Rating [ up ] [ down ]

Instructions

Your program should output a tree showing the structure of an XML
document, indented with 4 spaces for each depth of the tree.

All XML will be well-formed.

Tags may be closed within the tag itself (<tag />)

XML will not contain <> within attributes, comments or 
CDATA segments.

The XML will not contain the <?xml tag.

The XML may contain comments (<!--). These should be ignored.

Whitespace in the XML is considered to follow normal XML rules.

Example

Show/hide Input
<html>
  <head>
    <title />
  </head>
  <body>
  <!-- Some comment -->
    <hr/>
    <div>
      <div>asd</div>
    </div>
  </body>
</html>
Show/hide Output
html
    head
        title
    body
        hr
        div
            div

Comments

Show/hide comments (0)