Changeset 33887 in project


Ignore:
Timestamp:
03/12/17 22:36:37 (8 months ago)
Author:
LemonBoy
Message:

Introduce a short blurb about how the abbreviated SXPath is expanded.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • wiki/eggref/4/sxpath

    r28557 r33887  
    6262The optional association list of variables must include all the variables
    6363defined by the {{sxpath}} expression.
     64
     65The {{path}} is translated to the full SXPath according to the following
     66rewriting rules:
     67
     68<enscript highlight="scheme">
     69; (sxpath '()) -> (node-join)
     70; (sxpath '(path-component ...)) ->
     71;               (node-join (sxpath1 path-component) (sxpath '(...)))
     72; (sxpath1 '//) -> (sxml:descendant-or-self sxml:node?)
     73; (sxpath1 '(equal? x)) -> (select-kids (node-equal? x))
     74; (sxpath1 '(eq? x))    -> (select-kids (node-eq? x))
     75; (sxpath1 '(*or* ...))  -> (select-kids (ntype-names??
     76;                                          (cdr '(*or* ...))))
     77; (sxpath1 '(*not* ...)) -> (select-kids (sxml:complement
     78;                                         (ntype-names??
     79;                                          (cdr '(*not* ...)))))
     80; (sxpath1 '(ns-id:* x)) -> (select-kids
     81;                                      (ntype-namespace-id?? x))
     82; (sxpath1 ?symbol)     -> (select-kids (ntype?? ?symbol))
     83; (sxpath1 ?string)     -> (txpath ?string)
     84; (sxpath1 procedure)   -> procedure
     85; (sxpath1 '(?symbol ...)) -> (sxpath1 '((?symbol) ...))
     86; (sxpath1 '(path reducer ...)) ->
     87;               (node-reduce (sxpath path) (sxpathr reducer) ...)
     88; (sxpathr number)      -> (node-pos number)
     89; (sxpathr path-filter) -> (filter (sxpath path-filter))
     90</enscript>
    6491
    6592It can be useful to compare the following examples to those for
Note: See TracChangeset for help on using the changeset viewer.