;;; Examples of use of the lx syntax to do namespacing ;;; Basic use (conversation (hello where: there (how are you (today))) (response either: "in the pink" or: awful)) ;;; Namespaces (lx:namespace ((bk "urn:loc.gov:books") (isbn "urn:ISBN:0-395-36341-6")) (bk:book (bk:title "Cheaper by the Dozen") (isbn:number 1568491379))) ;;; Namespace defaulting (lx:namespace ((#f "urn:loc.gov:books") (isbn "urn:ISBN:0-395-36341-6")) (book (title "Cheaper by the Dozen") (isbn:number 1568491379))) ;;; More ways (lx:namespace ((#f "urn:loc.gov:books") ("" "urn:ISBN:0-395-36341-6") (html #f)) (book (title "Cheaper by the Dozen") (html:title "Cheaper by the Dozen") (:number 1568491379))) (lx:feature (("http://ns.nxg.me.uk/lx/attributes-in-no-namespace" #t)) (lx:namespace ((#f "http://www.w3.org/1999/XSL/Transform") ("" #f)) (lx:dtd ((when (test #t)) (template (match #t))) (template / (choose (when @id (value-of select: @id)) (otherwise (:em "Nothing"))))))) ;;; Following) requires defaulting of attributes. Note no need to escape ;;; less-than sign. (lx:feature ("http://ns.nxg.me.uk/lx/attributes-inherit-namespace") (lx:namespace ((#f "http://www.w3.org/1999/XSL/Transform")) (lx:dtd ((when (test #t)) (template (match #t))) (stylesheet version: 1.5 (important-new-1.1-declaration) (template / (choose (when "system-property('xsl:version') < 1.1" (message terminate: yes (text "Sorry, this stylesheet " "requires XSLT 1.1."))) (otherwise ;; ... ))) ;; ... ))))