manpagez: man pages & more
info guile
Home | html | info | man
[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

Matching XML Elements

The example below illustrates the pattern matching of an XML element:

(sxml-match '(e (@ (i 1)) 3 4 5)
  [(e (@ (i ,d)) ,a ,b ,c) (list d a b c)]
  [,otherwise #f])

Each clause in sxml-match contains two parts: a pattern and one or more expressions which are evaluated if the pattern is successfully match. The example above matches an element e with an attribute i and three children.

Pattern variables are must be “unquoted” in the pattern. The above expression binds d to 1, a to 3, b to 4, and c to 5.


This document was generated on April 20, 2013 using texi2html 5.0.

© manpagez.com 2000-2019
Individual documents may contain additional copyright information.