Changeset 13421 in project


Ignore:
Timestamp:
02/28/09 14:50:47 (11 years ago)
Author:
sjamaan
Message:

Clarify the use of ns-bindings, fix a few examples, fix hyperlink syntax

File:
1 edited

Legend:

Unmodified
Added
Removed
  • wiki/eggref/4/sxpath

    r13415 r13421  
    3232SXML document tree using an s-expression based language, in which you
    3333can also use arbitrary procedures and even "classic" textual XPath
    34 (see [#txpath|below] for docs on that).
     34(see [[#txpath|below]] for docs on that).
    3535
    3636A complete description on how to use this is outside the scope of this
     
    4646The optional {{ns-binding}} argument is an alist of namespace
    4747bindings.  It is used to map abbreviated namespace prefixes to full
    48 URI strings.
     48URI strings but ''only for textual XPath strings'' embedded in the
     49{{path}} expression.
    4950
    5051It can be useful to compare the following examples to those for
    51 [#txpath|txpath].
     52[[#txpath|txpath]].
    5253
    5354<examples>
     
    6768;; selects the 'chapter' children of the context node that have one or
    6869;; more 'title' children with string-value equal to 'Introduction'
    69 (sxpath '((chapter ((equal? (title "Introduction")))))
     70((sxpath '((chapter ((equal? (title "Introduction"))))))
    7071 '(text  (chapter (title "Introduction"))  (chapter "No title for this chapter")  (chapter (title "Conclusion"))))
    7172</expr>
     
    7778<expr>
    7879;; (sxpath string-expr) is equivalent to (txpath string-expr)
    79 (sxpath "chapter[title='Introduction']"
     80((sxpath "chapter[title='Introduction']")
    8081 '(text  (chapter (title "Introduction"))  (chapter "No title for this chapter")  (chapter (title "Conclusion"))))
    8182</expr>
    8283<result>
    83 </result>
    84 </example>
    85 </examples>
    86 
    87 TODO: find out how ns-binding works and give an example that uses this.
     84((chapter (title "Introduction")))
     85</result>
     86</example>
     87</examples>
     88
    8889
    8990<procedure>(if-sxpath path)</procedure>
     
    161162
    162163It's useful to compare the following examples to the above examples
    163 for [#sxpath|sxpath].
     164for [[#sxpath|sxpath]].
    164165
    165166<examples>
     
    424425Like {{sxml:name}}, except returns only the local part of the name
    425426(called an "NCName" in the
    426 [http://www.w3.org/TR/xml-names/|XML namespaces spec]).
     427[[http://www.w3.org/TR/xml-names/|XML namespaces spec]]).
    427428
    428429The node's name is interpreted as a "Qualified Name", a
Note: See TracChangeset for help on using the changeset viewer.