We quickly give an overview of pattern syntax and semantic.

String

  "a string"               (1)
  CDATA                    (2)
	      
  1. only matches strings like "a string"
  2. matches any string.
Sequence

  (* empty *)              (1)
  _                        (2)
  _?                       (1+2)
  _+                       (3)
  _*                       (4)
	      
  1. matches empty term
  2. matches a tag or a string
  3. matches a sequence of tag or string (could be empty)
  4. matches a sequence of tag or string (at least one)
Tag content

  <_> </>                  (1)
  <_> _+ </>               (2)
  <_> _* </>               (1+2)      
	      
  1. matches any tag with an empty content
  2. matches any tag with a non empty content
Tag name without namespace

  <A> </>                  (1)
  <(A|B)> </>              (2a)
  (<A> </>|<B> </>)        (2b)
	      
  1. matches tag named A
  2. matches tag named A or B
Tag name with namespace

  <_:A> </>                (1)
  <N:(A|B)> </>            (2a)
  (<N:A> </>|<N:B> </>)    (2b)
  <(N|M):(A|B) </>         (3)
	      
  1. matches tag named A in any namespace same as <A> </>
  2. matches tag named A or B in a namespace N
  3. matches tag named A or B in a namespace N or M
Tag attribute

  <_ att=CDATA> </>        (1)
  <_ att=CDATA?> </>       (2)
  <_ N:att=CDATA> </>      (3)
  <_ _="v1"> </>           (4)
  <_ N:_="v1"> </>         (5)
  <_ _:att="v1"> </>       (6)
	      
  1. matches any tag with a valued attribute att
  2. matches any tag with may be a valued attribute att
  3. matches any tag with a valued attribute att in a namespace N
  4. matches a tag with an attribute with a value "v1"
  5. matches a tag with an attribute in a namespace N with a value "v1"
  6. same as (2)
Binding fragment

  _ as h                   (1)
  _ as head _* as tail     (2)
  _* as liat _ as deah     (3)
  <_ as tn> </>            (4)
  <_ as ns:_ as tn> </>    (5)
  <_ attributes> </>       (6)

	      
  1. h has the same value as t
  2. t = head tail with t a non empty sequence
  3. t = liat deah with t a non empty sequence and deah is the last element
  4. tn is binded with the tag name (no namespace)
  5. ns is binded with the namespace and tn is binded with the tag name
  6. attributes is binded with all attributes in the matched tag