Changeset 13428 in project


Ignore:
Timestamp:
02/28/09 16:54:32 (11 years ago)
Author:
sjamaan
Message:

Make the example for sxml:id-alist less confusing

File:
1 edited

Legend:

Unmodified
Added
Removed
  • wiki/eggref/4/sxpath

    r13427 r13428  
    117117<example>
    118118<expr>
    119 ;; TODO: find out why location paths must be of the form (expr '@ symbol)
    120 ;;       or if this description is incorrect
     119;; Obtain ID values for a regular XHTML DOM
    121120(sxml:id-alist
    122  '(div (span (@ (id "hi")) "there")
    123        (div (@ (id "hello")) "dude")
    124        (a (@ (id "link")) "click here"))
    125  '(span @ id) '(a @ id))
    126 </expr>
    127 <result>
    128 (("hi" . (span (@ (id "hi")) "there"))
    129  ("link" . (a (@ (id "link")) "click here")))
     121 '(div (h1 (@ (id "info"))
     122           "A story")
     123       (p (@ (id "story-body"))
     124          "Once upon a time")
     125       (a (@ (id "back") (href "../index.xml"))
     126          "click here to go back"))
     127 '(* @ id))
     128</expr>
     129<result>
     130(("info" h1 (@ (id "info")) "A story")
     131 ("story-body" p (@ (id "story-body")) "Once upon a time")
     132 ("back" a (@ (id "back") (href "../index.xml")) "click here to go back"))
     133</result>
     134</example>
     135<example>
     136<expr>
     137;; In an alternate reality, where links are uniquely identified
     138;; by their href, we would use this
     139(sxml:id-alist
     140 '(div (h1 (@ (id "info"))
     141           "A story")
     142       (p (@ (id "story-body"))
     143          "Once upon a time")
     144       (a (@ (id "back") (href "../index.xml"))
     145          "click here to go back"))
     146 '(h1 @ foo) '(a @ href))
     147</expr>
     148<result>
     149(("../index.xml" . (a (@ (id "back")
     150                         (href "../index.xml"))
     151                      "click here to go back")))
    130152</result>
    131153</example>
Note: See TracChangeset for help on using the changeset viewer.