aboutsummaryrefslogtreecommitdiff
path: root/examples/working-loaded/xml.test
blob: 000697fcd3d84f344b47977b8662be9f4eced898 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
"lib/xml.ey" include

{ ==indent ==elem
  indent { " " sys .out .writeall } rep
  elem .name "" eq {
    elem .text sys .out .writeall "\n" sys .out .writeall
  } {
    elem .name sys .out .writeall "\n" sys .out .writeall
    elem .children {
      indent 2 add dumpTree
    } each
  } ? *
} /dumpTree deffst

sys .file ":" via
  "xml.test.xml" :open
  65536 :read ==content
  :close

1 ==success
{
  content xml .parse
} {
  "Error during parse, remaining content: " dump
  .remaining dump
  0 =success
} ?!parse

success { 0 dumpTree } rep

# vim: syn=elymas