Functional XML

Henry S. Thompson
ICCS/HCRC
School of Informatics
University of Edinburgh
 
W3C Team
and
Technical Architecture Group
 
Markup Technology Ltd.
 
 
29 June 2005

1. Acknowledgements

The work reported here was initiated by an idea of Tim Berners-Lee, who also first used the phrase "functional XML" in my hearing. The basic direction was first suggested by Richard Tobin.

2. The functional perspective on XML

3. The λ-XML approach

4. λ-XML namespace semantics

5. The λ-XML approach

6. Introducing basic λ-XML

7. The power of λ-XML

8. λ-XML unchained

9. Summary of λ-XML so far

10. Completing basic λ-XML

11. Initial inventory of λ-XML elements

12. Namespace or programming language: Compact notation for λ-XML

13. Inspirations from Scheme -- Conditionals

(cond ((λ:test "po.xml" [/root/@version > 3])
           (PSVI "po.xml" "current.xsd"))
       (true (PSVI "po.xml" "stale.xsd")))

14. Better conditionals, with binding

(let ((doc "po.xml"))
 (cond ([$doc/root/@version > 3]
           (PSVI $doc "current.xsd"))
       ([true] (PSVI $doc "stale.xsd"))))

15. Inspirations from Scheme -- Mapping

(λ:mapped [item/price]
         (λ (subdoc)
           <amount currency="USD">
            <xi:include href="#subdoc"/>
           </amount>)
         "po.xml")

16. Possible further extensions

(λ:templateApplied
 <xsl:template match="item/price">
  <amount currency="USD">
   <xsl:apply-templates/>
  </amount>
 </xsl:template>
 "po.xml")

17. A note about media types

18. Implementation strategy

19. Conclusion