EXPath  A packaging system for XML libraries and a portable web application framework XML Prague, March 13 th , 2010   F...
EXPath <ul><li>Introduction   ←
Simple examples
The packaging system
Web applications
A comprehensive example
Conclusion </li></ul>
Introduction - History <ul><li>EXSLT for XSLT 1.0
XSLT 2.0 and needs for new extensions
EXSLT 2.0, EXQuery & EXProc
XML Prague 2009 – EXPath
First modules – HTTP Client & ZIP Facility
Balisage 2009 – the Packaging System
XML Prague 2010 – the Webapp module </li></ul>
Introduction - Scope <ul><li>Quite vague  (that is a feature, not a bug)
Extensions for XPath of course
But also: XSLT, XQuery, XProc (and XForms, XML Schema, DSDL, etc.; that is, XML technologies)
Mainly extension functions
But also: servlet container, packaging system... </li></ul>
Introduction - Goals <ul><li>Collaboratively defining open standards for portable XPath extensions
The main means is extension functions
The main goal is defining portable specifications...
...and convincing vendors to endorse them
But also providing support to open-source implementations </li></ul>
Introduction - Processes <ul><li>More or less formal, more or less informal  (that is a feature, not a bug)
The definitive goal is writing specifications
The main tool is the mailing list
Each module has one main maintainer, responsible of editing & achieving consensus
Other tools include Subversion repositories, public Wiki, etc.
More infos about processes on the wiki </li></ul>
EXPath <ul><li>Introduction
Simple examples   ←
Upcoming SlideShare
Loading in...5
×

EXPath: the packaging system and the webapp framework

974

Published on

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
974
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
9
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

EXPath: the packaging system and the webapp framework

  1. 1. EXPath A packaging system for XML libraries and a portable web application framework XML Prague, March 13 th , 2010 Florent Georges H2O Consulting
  2. 2. EXPath <ul><li>Introduction ←
  3. 3. Simple examples
  4. 4. The packaging system
  5. 5. Web applications
  6. 6. A comprehensive example
  7. 7. Conclusion </li></ul>
  8. 8. Introduction - History <ul><li>EXSLT for XSLT 1.0
  9. 9. XSLT 2.0 and needs for new extensions
  10. 10. EXSLT 2.0, EXQuery & EXProc
  11. 11. XML Prague 2009 – EXPath
  12. 12. First modules – HTTP Client & ZIP Facility
  13. 13. Balisage 2009 – the Packaging System
  14. 14. XML Prague 2010 – the Webapp module </li></ul>
  15. 15. Introduction - Scope <ul><li>Quite vague (that is a feature, not a bug)
  16. 16. Extensions for XPath of course
  17. 17. But also: XSLT, XQuery, XProc (and XForms, XML Schema, DSDL, etc.; that is, XML technologies)
  18. 18. Mainly extension functions
  19. 19. But also: servlet container, packaging system... </li></ul>
  20. 20. Introduction - Goals <ul><li>Collaboratively defining open standards for portable XPath extensions
  21. 21. The main means is extension functions
  22. 22. The main goal is defining portable specifications...
  23. 23. ...and convincing vendors to endorse them
  24. 24. But also providing support to open-source implementations </li></ul>
  25. 25. Introduction - Processes <ul><li>More or less formal, more or less informal (that is a feature, not a bug)
  26. 26. The definitive goal is writing specifications
  27. 27. The main tool is the mailing list
  28. 28. Each module has one main maintainer, responsible of editing & achieving consensus
  29. 29. Other tools include Subversion repositories, public Wiki, etc.
  30. 30. More infos about processes on the wiki </li></ul>
  31. 31. EXPath <ul><li>Introduction
  32. 32. Simple examples ←
  33. 33. The packaging system
  34. 34. Web applications
  35. 35. A comprehensive example
  36. 36. Conclusion </li></ul>
  37. 37. Examples – HTTP Client <ul><li>A single function to send HTTP requests and handle corresponding responses
  38. 38. Get the description of the request as an XML element (with verb, headers, content...)
  39. 39. Return a description of the response as an XML element (with code, headers, content...)
  40. 40. Actually the content is handled differently (as separate items, either text, XML, HTML or binary) to avoid the SOAP envelope syndrome </li></ul>
  41. 41. Examples – HTTP Client http:send-request ( $ request as element (http:request)) as item () + <http:request href = &quot;http://www.example.com/...&quot; method = &quot;post&quot; > <http:header name = &quot;X-Header&quot; value = &quot;some value&quot; /> <http:body content-type = &quot;application/xml&quot; > <hello> World! </hello> </http:body> </http:request> <http:response status = &quot;200&quot; message = &quot;Ok&quot; > <http:header name = &quot;...&quot; value = &quot;...&quot; /> ... <http:body content-type = &quot;application/xml&quot; /> </http:response>
  42. 42. Examples – ZIP Facility <ul><li>List entries: </li><ul><li>zip:entries ( $ href) as element (zip:file) </li></ul><li>Extract entries: </li><ul><li>zip:xml-entry ( $ href, $ path) as document-node ()
  43. 43. zip:html-entry ( $ href, $ path) as document-node ()
  44. 44. zip:text-entry ( $ href, $ path) as xs:string
  45. 45. zip:binary-entry ( $ href, $ path) as xs:base64Binary </li></ul><li>Create new ZIP files: </li><ul><li>zip:zip-file ( $ zip) as empty ()
  46. 46. zip:update-entries ( $ zip, $ output) as empty () </li></ul></ul>
  47. 47. Examples – Google Contacts
  48. 48. Examples – Google Contacts
  49. 49. EXPath <ul><li>Introduction
  50. 50. Simple examples
  51. 51. The packaging system ←
  52. 52. Web applications
  53. 53. A comprehensive example
  54. 54. Conclusion </li></ul>
  55. 55. Packaging – The problem <ul><li>How to install a library of UBL format helpers?
  56. 56. Depends on the processor
  57. 57. Easy: just copy the files somewhere
  58. 58. To use them, adapt the XSLT import URI or the XQuery import at hint in your using stylesheets or queries </li><ul><li><xsl:import href = &quot; file:///c:/xquery/ubl-helpers/mod-1.xsl &quot; />
  59. 59. import module namespace ubl = &quot;http://fgeorges.org/ubl/mod-1&quot; at &quot;dadb://modules/ubl-helpers/mod-1.xql&quot; ; </li></ul></ul>
  60. 60. Packaging – Houston, we've... <ul><li>But UBL Helpers actually use FunctX
  61. 61. So you have to change the import statements throughout this third-party library
  62. 62. Wait a minute, no problem, really, UBL Helpers have to include FunctX
  63. 63. But your application uses another library, which in turn also uses FunctX
  64. 64. ... </li></ul>
  65. 65. Packaging – Intermezzo <ul><li>OASIS XML Catalogs provide a bit of fresh air
  66. 66. They help avoiding the requirement of changing import statements...
  67. 67. ...as long as everyone agree on URIs to use in import statements
  68. 68. They must then be supported by all products
  69. 69. One has to install configure catalogs for its system by hand, again and again </li></ul>
  70. 70. Packaging – Standard format <ul><li>The solution lays in a standard format to describe X* components </li><ul><li>Must describe what is needed but is not in the X* specifications (well-defined import URIs)
  71. 71. Must be understood by most processors (suitable for standard libraries)
  72. 72. Must package the components and additional informations in a single file (suitable as a delivery format)
  73. 73. Must be eXtensible (that's X ML, isn't it?) </li></ul><li>Installation process can then be automated </li></ul>
  74. 74. Packaging – Overview
  75. 75. Packaging – Tools <ul><li>Standard on-disk repository layout
  76. 76. Command-line repository manager
  77. 77. Implementation for Saxon (XQuery, XSLT)
  78. 78. Implementation for Calabash (RELAX NG RNG + RNC, Schematron, XProc, XQuery, XML Schema and XSLT)
  79. 79. Implementations provide a Java API as well as command-line scripts </li></ul>
  80. 80. Packaging – Further <ul><li>Repository manager can install directly from the web </li><ul><li>xrepo install http://cxan.org/xxx.xar </li></ul><li>That leads to the idea of CXAN (like CPAN for Perl or CTAN for TeX/LaTeX): a global, online repository of existing package </li><ul><li>cxan install functx </li></ul><li>A key point is user and vendor adoption, and support in existing tools like IDEs </li></ul>
  81. 81. Packaging – Projects <ul><li>The package format is low-level and strict </li><ul><li>e.g. require the target namespace for an XQuery module in the package descriptor </li></ul><li>Using simple conventions, it is possible to create consistent project structure
  82. 82. Other info can be added in the component source files
  83. 83. Structure and annotations captures some packaging information, used by a packager </li></ul>
  84. 84. Packaging – Projects <ul><li>Low-level specifications are technical and strict
  85. 85. They are as less as possible
  86. 86. Conventions are flexible
  87. 87. They can be used to ease developer's day-to-day life, by automating repetitive tasks
  88. 88. They can be used to define different kinds of projects </li><ul><li>Standard X* library, extension, webapp, tests... </li></ul></ul>
  89. 89. EXPath <ul><li>Introduction
  90. 90. Simple examples
  91. 91. The packaging system
  92. 92. Web applications ←
  93. 93. A comprehensive example
  94. 94. Conclusion </li></ul>
  95. 95. Webapps – Intro <ul><li>Using X* technologies end-to-end for web applications
  96. 96. Most existing XML databases provide proprietary framework for that (eXist, MarkLogic, Sausalito, etc.)
  97. 97. Then again, we are stuck with processor-locked applications
  98. 98. A standard would allow to write portable web applications, libraries and frameworks </li></ul>
  99. 99. Webapps – Principles <ul><li>Not define all aspects of web applications
  100. 100. A component can be an XQuery function or module, an XSLT function, template or stylesheet, or an XProc pipeline
  101. 101. The only technical missing piece is a way to map HTTP requests to components
  102. 102. That means dispatching and providing infos </li></ul>
  103. 103. Webapps – Mapping <ul><li>URLs are matched by regular expressions, and associated to a component
  104. 104. A component is identified by its name (if applicable) and the import URI of it module
  105. 105. This is configured in a simple descriptor
  106. 106. ...and packaged using the Packaging System
  107. 107. The Packaging System already provides setting of the component's public URIs
  108. 108. The web descriptor simply builds on top of that </li></ul>
  109. 109. Webapps – Requests <web:request servlet = &quot;name&quot; path = &quot;/path&quot; method = &quot;get&quot; > <web:uri> http://example.org/my-app/path </web:uri> <web:authority> http://example.org </web:authority> <web:context-root> /my-app </web:context-root> <web:path> <web:part> path </web:part> </web:path> <web:header name = &quot;connection&quot; value = &quot;keep-alive&quot; /> ... </web:request> <web:response status = &quot;200&quot; message = &quot;Ok&quot; > <web:header name = &quot;...&quot; value = &quot;...&quot; /> ... <web:body content-type = &quot;text/html&quot; method = &quot;xhtml&quot; /> </http:response>
  110. 110. Webapps – Servlex <ul><li>Servlex is an early implementation
  111. 111. Server technology is Java Servlet
  112. 112. XSLT and XQuery are provided by Saxon
  113. 113. XProc is (going to be) provided by Calabash
  114. 114. Webapp manager to (un)deploy applications </li></ul>
  115. 115. EXPath <ul><li>Introduction
  116. 116. Simple examples
  117. 117. The packaging system
  118. 118. Web applications
  119. 119. A comprehensive example ←
  120. 120. Conclusion </li></ul>
  121. 121. Freedom <ul><li>A web application to download a backup of your data in some Google services
  122. 122. Use EXPath ZIP Facility
  123. 123. Use EXPath HTTP Client
  124. 124. Use Google API XSLT libraries
  125. 125. Use OAuth-like authentication </li></ul>
  126. 126. That's all Folks! <ul><li>Join the mailing list and browse the website:
  127. 127. http://expath.org/ </li></ul>
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×