SlideShare a Scribd company logo
EXPath
A practical introduction

  Balisage, August 13th, 2009




       Florent Georges
          fgeorges.org
EXPath
          A practical introduction
●
    Introduction                     ←
●   The project
●   HTTP Client
●   ZIP facility
●   Packaging
●   Putting it all together
●   Sibling projects
Introduction

●   XPath is a textual language to navigate XDM
    trees
●   It is used standalone or embedded in XSLT,
    XQuery, XProc, XForms, and other languages
●   A recommendation defines a standard library
    of functions
●   An implementation or host language can
    provide additional functions: the extension
    functions
Introduction

●   More and more demand for extensions for
    XSLT 2.0 and XQuery for one year
●   Extension functions are the easiest way
●   They are at the XPath level
●   Acting at the XPath level allows them to be
    used in another languages
●   XProc is a good example of such another
    language (EXProc defines also extensions for
    a few months)
EXPath
          A practical introduction
●   Introduction
●
    The project                      ←
●   HTTP Client
●   ZIP facility
●   Packaging
●   Putting it all together
●   Sibling projects
The project

●   Collaborative
●   The base delivery unit is the module
●   The main deliverable is the specification
●   Each module has its own maintainer
●   Implementations as external extensions are
    encouraged during specification
●   Independent on any particular vendor
●   ...though they are welcome, of course ;-)
The project

●   Extension functions libraries
●   But also:
        –   Testing framework (based on Jeni's XSpec?)
        –   Documentation system (based on Ken's
             XSLStyle?)
        –   General-purpose packaging system
        –   Help identifying best practices
        –   Servlet-like container
        –   ...
EXPath
          A practical introduction
●   Introduction
●   The project
●
    HTTP Client                      ←
●   ZIP facility
●   Packaging
●   Putting it all together
●   Sibling projects
HTTP Client

●   Send HTTP requests and handle responses
●   Based on the XProc step p:http-request
●   Enable one to:
       –   Retrieve plain resources on the web
       –   Query REST-based Web sevices
       –   Query SOAP-based Web services
       –   Query Google services
HTTP Client
http:send-request($request as element(http:request)) as item()+
HTTP Client
http:send-request($request as element(http:request)) as item()+


<http:request href="http://www.example.com/..." method="post">
  <http:header name="X-Header" value="some value"/>
  <http:body content-type="application/xml">
    <hello>World!</hello>
  </http:body>
</http:request>
HTTP Client
http:send-request($request as element(http:request)) as item()+


<http:request href="http://www.example.com/..." method="post">
  <http:header name="X-Header" value="some value"/>
  <http:body content-type="application/xml">
    <hello>World!</hello>
  </http:body>
</http:request>


<http:response status="200" message="Ok">
  <http:header name="..." value="..."/>
  ...
  <http:body content-type="application/xml"/>
</http:response>
HTTP Client
http:send-request(
  <http:request href="http://www.balisage.net/" method="get"/>)
↘
(
    ?
)
HTTP Client
http:send-request(
  <http:request href="http://www.balisage.net/" method="get"/>)
↘
(
  <http:response status="200" message="OK">
    <http:header name="Server" value="Apache/1.3.41 (Unix) ..."/>
    ...
    <http:body content-type="text/html"/>
  </http:response>
,
   ?
)
HTTP Client
http:send-request(
  <http:request href="http://www.balisage.net/" method="get"/>)
↘
(
  <http:response status="200" message="OK">
    <http:header name="Server" value="Apache/1.3.41 (Unix) ..."/>
    ...
    <http:body content-type="text/html"/>
  </http:response>
,
  <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <title>Balisage: The Markup Conference</title>
        ...
)
HTTP Client

●   Live samples:
       –   XQuery with Saxon, MarkLogic and eXist
       –   Google's GData API
       –   WSDL Compiler
EXPath
          A practical introduction
●   Introduction
●   The project
●   HTTP Client
●
    ZIP facility                     ←
●   Packaging
●   Putting it all together
●   Sibling projects
ZIP facility

●   Read and write ZIP files
        –   List all entries
        –   Extract specific entries
        –   Update existing entries
        –   Create brand-new ZIP files
●   Well suited for XML + ZIP documents
    (OpenDocument, Open XML, EPUB, etc.)
ZIP facility
●   List entries:
          –   zip:entries($href) as element(zip:file)
●   Extract entries:
          –   zip:xml-entry($href, $path) as document-node()
          –   zip:html-entry($href, $path) as document-node()
          –   zip:text-entry($href, $path) as xs:string
          –   zip:binary-entry($href, $path) as xs:base64Binary
●   Create new ZIP files:
          –   zip:zip-file($zip) as empty()
          –   zip:update-entries($zip, $output) as empty()
ZIP facility
<zip:file href="some.zip" xmlns:zip="http://www.expath.org/mod/zip">
  <zip:entry name="file.xml" output="xml">
    <hello>World!</hello>
  </zip:entry>
  <zip:entry name="index.html" output="html" href="/some/file.html"/>
  <zip:dir name="dir">
    <zip:entry name="file.txt" output="text">
      Hello, world!
    </zip:entry>
  </zip:dir>
</zip:file>
ZIP facility

●   Live samples:
       –   List entries in a ZIP file
       –   Extract an XML entry
       –   Create a new file
ZIP facility

●   “Compound Document Template” pattern
●   Create a new ZIP file by copying an existing
    one, updating and adding some entries
●   For instance, you can edit a text document
    directly within OpenOffice, and use it as a
    template to format an input data document
ZIP facility
EXPath
          A practical introduction
●   Introduction
●   The project
●   HTTP Client
●   ZIP facility
●
    Packaging                        ←
●   Putting it all together
●   Sibling projects
Packaging

●   Support XSLT, XQuery and XProc
●   Can be extended for other X* technologies
●   Independent on the processor for std X* files
●   Allow processor-dependent features          (i.e.
    for Java extension functions)
●   Support only deploying libraries
●   Can be used as a building block for more
    complex frameworks, like XRX
Packaging

●   Deployment descriptor:
<package xmlns="http://expath.org/mod/expath-pkg">
  <module version="0.1" name="google-xslt">
    <title>Simple XQuery package for tests</title>
    <xsl>
        <import-uri>http://www.fgeorges.org/google/gdata.xsl</import-uri>
        <file>xsl/gdata.xsl</file>
    </xsl>
    ...
  </module>
</package>
Packaging

●   Example of use:
<xsl:stylesheet xmlns:f="http://fxsl.sf.net/" version="2.0">

 <xsl:import href="http://fxsl.sf.net/f/func-Fibonacci.xsl"/>

 <xsl:template match="/" name="main">
   <fibo>
     <xsl:value-of select="f:fibo(10)"/>
   </fibo>
 </xsl:template>

</xsl:stylesheet>
Packaging
Packaging

●   Examples:
       –   Deploy XSLT and XQuery for Saxon
       –   Deploy Java extensions for Saxon
       –   Deploy XQuery for eXist
       –   Deploy Java extensions for eXist
Packaging

●   For now, use an external application to deploy
●   Limited to the processor's mechanism to
    resolve URIs
●   For some processors, not possible to deploy
    without changing importing stylesheets/queries
●   Ideal situation: supported natively by a broad
    number of processors
●   Is a support for other frameworks, and CXAN
Packaging

●    In XSLT
    <!-- the public and absolute import URI -->
    <xsl:import href="http://www.expath.org/mod/http-client.xsl"/>
●    In XQuery? There is no convention.
    import module namespace
      http = "http://www.expath.org/mod/http-client"
      at "http://www.expath.org/mod/http-client.xq";
- versus -
    import module namespace
      http = "http://www.expath.org/mod/http-client";
EXPath
          A practical introduction
●   Introduction
●   The project
●   HTTP Client
●   ZIP facility
●   Packaging
●
    Putting it all together          ←
●   Sibling projects
Putting it all together

●   Use the HTTP Client to access various Google
    APIs (REST Web services): contacts, maps, ...
●   Use ZIP facility and the Compound Document
    Template pattern
●   All those libraries are accessed through the
    Packaging System
Putting it all together
EXPath
          A practical introduction
●   Introduction
●   The project
●   HTTP Client
●   ZIP facility
●   Packaging
●   Putting it all together
●
    Sibling projects                 ←
Sibling projects

●   EXQuery, EXSLT 2.0, and EXProc
●   Where's the border?
       –   EXPath Packaging system
       –   Servlet-like container definition
       –   Full XRX container definition
That's all Folks!

●   Plenty of other potential extensions
●   More low-level and general-purpose: nested
    sequences and first-class function items
●   Join the mailing list and browse the website:


              http://www.expath.org/
Balisage - EXPath - A practical introduction

More Related Content

What's hot

Everything you ever wanted to know about lotus script
Everything you ever wanted to know about lotus scriptEverything you ever wanted to know about lotus script
Everything you ever wanted to know about lotus script
Bill Buchan
 
Like loggly using open source
Like loggly using open sourceLike loggly using open source
Like loggly using open source
Thomas Alrin
 
M|18 Architectural Overview: MariaDB MaxScale
M|18 Architectural Overview: MariaDB MaxScaleM|18 Architectural Overview: MariaDB MaxScale
M|18 Architectural Overview: MariaDB MaxScale
MariaDB plc
 
Thrift vs Protocol Buffers vs Avro - Biased Comparison
Thrift vs Protocol Buffers vs Avro - Biased ComparisonThrift vs Protocol Buffers vs Avro - Biased Comparison
Thrift vs Protocol Buffers vs Avro - Biased Comparison
Igor Anishchenko
 
Fluentd vs. Logstash for OpenStack Log Management
Fluentd vs. Logstash for OpenStack Log ManagementFluentd vs. Logstash for OpenStack Log Management
Fluentd vs. Logstash for OpenStack Log Management
NTT Communications Technology Development
 
HornetQ Presentation On JBoss World 2009
HornetQ Presentation On JBoss World 2009HornetQ Presentation On JBoss World 2009
HornetQ Presentation On JBoss World 2009
jarfield
 
Python mongo db-training-europython-2011
Python mongo db-training-europython-2011Python mongo db-training-europython-2011
Python mongo db-training-europython-2011
Andreas Jung
 
Xml parsers
Xml parsersXml parsers
Xml parsers
Manav Prasad
 
9781305078444 ppt ch02
9781305078444 ppt ch029781305078444 ppt ch02
9781305078444 ppt ch02
Terry Yoast
 
3 apache-avro
3 apache-avro3 apache-avro
3 apache-avro
zafargilani
 
9781305078444 ppt ch04
9781305078444 ppt ch049781305078444 ppt ch04
9781305078444 ppt ch04
Terry Yoast
 
NoSQL and JavaScript: a Love Story
NoSQL and JavaScript: a Love StoryNoSQL and JavaScript: a Love Story
NoSQL and JavaScript: a Love Story
Alexandre Morgaut
 
The architecture of oak
The architecture of oakThe architecture of oak
The architecture of oak
Michael Dürig
 
Jug java7
Jug java7Jug java7
Jug java7
Dmitry Buzdin
 
Attack monitoring using ElasticSearch Logstash and Kibana
Attack monitoring using ElasticSearch Logstash and KibanaAttack monitoring using ElasticSearch Logstash and Kibana
Attack monitoring using ElasticSearch Logstash and Kibana
Prajal Kulkarni
 
What is new in CFEngine 3.6
What is new in CFEngine 3.6What is new in CFEngine 3.6
What is new in CFEngine 3.6
Jonathan Clarke
 
Ninja Build: Simple Guide for Beginners
Ninja Build: Simple Guide for BeginnersNinja Build: Simple Guide for Beginners
Ninja Build: Simple Guide for Beginners
Chang W. Doh
 
Git session-2012-2013
Git session-2012-2013Git session-2012-2013
Git session-2012-2013
Jose Manuel Vega Monroy
 
Intro to GemStone/S
Intro to GemStone/SIntro to GemStone/S
Intro to GemStone/S
ESUG
 

What's hot (19)

Everything you ever wanted to know about lotus script
Everything you ever wanted to know about lotus scriptEverything you ever wanted to know about lotus script
Everything you ever wanted to know about lotus script
 
Like loggly using open source
Like loggly using open sourceLike loggly using open source
Like loggly using open source
 
M|18 Architectural Overview: MariaDB MaxScale
M|18 Architectural Overview: MariaDB MaxScaleM|18 Architectural Overview: MariaDB MaxScale
M|18 Architectural Overview: MariaDB MaxScale
 
Thrift vs Protocol Buffers vs Avro - Biased Comparison
Thrift vs Protocol Buffers vs Avro - Biased ComparisonThrift vs Protocol Buffers vs Avro - Biased Comparison
Thrift vs Protocol Buffers vs Avro - Biased Comparison
 
Fluentd vs. Logstash for OpenStack Log Management
Fluentd vs. Logstash for OpenStack Log ManagementFluentd vs. Logstash for OpenStack Log Management
Fluentd vs. Logstash for OpenStack Log Management
 
HornetQ Presentation On JBoss World 2009
HornetQ Presentation On JBoss World 2009HornetQ Presentation On JBoss World 2009
HornetQ Presentation On JBoss World 2009
 
Python mongo db-training-europython-2011
Python mongo db-training-europython-2011Python mongo db-training-europython-2011
Python mongo db-training-europython-2011
 
Xml parsers
Xml parsersXml parsers
Xml parsers
 
9781305078444 ppt ch02
9781305078444 ppt ch029781305078444 ppt ch02
9781305078444 ppt ch02
 
3 apache-avro
3 apache-avro3 apache-avro
3 apache-avro
 
9781305078444 ppt ch04
9781305078444 ppt ch049781305078444 ppt ch04
9781305078444 ppt ch04
 
NoSQL and JavaScript: a Love Story
NoSQL and JavaScript: a Love StoryNoSQL and JavaScript: a Love Story
NoSQL and JavaScript: a Love Story
 
The architecture of oak
The architecture of oakThe architecture of oak
The architecture of oak
 
Jug java7
Jug java7Jug java7
Jug java7
 
Attack monitoring using ElasticSearch Logstash and Kibana
Attack monitoring using ElasticSearch Logstash and KibanaAttack monitoring using ElasticSearch Logstash and Kibana
Attack monitoring using ElasticSearch Logstash and Kibana
 
What is new in CFEngine 3.6
What is new in CFEngine 3.6What is new in CFEngine 3.6
What is new in CFEngine 3.6
 
Ninja Build: Simple Guide for Beginners
Ninja Build: Simple Guide for BeginnersNinja Build: Simple Guide for Beginners
Ninja Build: Simple Guide for Beginners
 
Git session-2012-2013
Git session-2012-2013Git session-2012-2013
Git session-2012-2013
 
Intro to GemStone/S
Intro to GemStone/SIntro to GemStone/S
Intro to GemStone/S
 

Viewers also liked

Puzzle Gigante
Puzzle GigantePuzzle Gigante
EXPath: the packaging system and the webapp framework
EXPath: the packaging system and the webapp frameworkEXPath: the packaging system and the webapp framework
EXPath: the packaging system and the webapp framework
Florent Georges
 
Quanti libri in un libro di Paola Romagnoli
Quanti libri in un libro di Paola RomagnoliQuanti libri in un libro di Paola Romagnoli
Quanti libri in un libro di Paola Romagnoli
Sistema Bibliotecario Ovest Bresciano
 
La narrazione in atto incroci e idee tra gioco e storie leggendo e inventanto...
La narrazione in atto incroci e idee tra gioco e storie leggendo e inventanto...La narrazione in atto incroci e idee tra gioco e storie leggendo e inventanto...
La narrazione in atto incroci e idee tra gioco e storie leggendo e inventanto...
Sistema Bibliotecario Ovest Bresciano
 
I gruppi di lettura come esperienza di salute e benessere di Roberto Spoldi
I gruppi di lettura come esperienza di salute e benessere   di Roberto SpoldiI gruppi di lettura come esperienza di salute e benessere   di Roberto Spoldi
I gruppi di lettura come esperienza di salute e benessere di Roberto Spoldi
Sistema Bibliotecario Ovest Bresciano
 

Viewers also liked (8)

Puzzle Gigante
Puzzle GigantePuzzle Gigante
Puzzle Gigante
 
EXPath: the packaging system and the webapp framework
EXPath: the packaging system and the webapp frameworkEXPath: the packaging system and the webapp framework
EXPath: the packaging system and the webapp framework
 
Quanti libri in un libro di Paola Romagnoli
Quanti libri in un libro di Paola RomagnoliQuanti libri in un libro di Paola Romagnoli
Quanti libri in un libro di Paola Romagnoli
 
La narrazione in atto incroci e idee tra gioco e storie leggendo e inventanto...
La narrazione in atto incroci e idee tra gioco e storie leggendo e inventanto...La narrazione in atto incroci e idee tra gioco e storie leggendo e inventanto...
La narrazione in atto incroci e idee tra gioco e storie leggendo e inventanto...
 
I gruppi di lettura come esperienza di salute e benessere di Roberto Spoldi
I gruppi di lettura come esperienza di salute e benessere   di Roberto SpoldiI gruppi di lettura come esperienza di salute e benessere   di Roberto Spoldi
I gruppi di lettura come esperienza di salute e benessere di Roberto Spoldi
 
De Veloceraptor
De VeloceraptorDe Veloceraptor
De Veloceraptor
 
De Stegosaurus
De StegosaurusDe Stegosaurus
De Stegosaurus
 
De Brachiosaurus
De BrachiosaurusDe Brachiosaurus
De Brachiosaurus
 

Similar to Balisage - EXPath - A practical introduction

EXPath Webapp - CXAN: a case-study for Servlex, an XML web framework
EXPath Webapp - CXAN: a case-study for Servlex, an XML web frameworkEXPath Webapp - CXAN: a case-study for Servlex, an XML web framework
EXPath Webapp - CXAN: a case-study for Servlex, an XML web framework
Florent Georges
 
TYPO3 Transition Tool
TYPO3 Transition ToolTYPO3 Transition Tool
TYPO3 Transition Tool
crus0e
 
Geospatial web services using little-known GDAL features and modern Perl midd...
Geospatial web services using little-known GDAL features and modern Perl midd...Geospatial web services using little-known GDAL features and modern Perl midd...
Geospatial web services using little-known GDAL features and modern Perl midd...
Ari Jolma
 
Building bridges - Plone Conference 2015 Bucharest
Building bridges   - Plone Conference 2015 BucharestBuilding bridges   - Plone Conference 2015 Bucharest
Building bridges - Plone Conference 2015 Bucharest
Andreas Jung
 
Easy access to open stack object storage
Easy access to open stack object storageEasy access to open stack object storage
Easy access to open stack object storage
Juan José Martínez
 
"Xapi-lang For declarative code generation" By James Nelson
"Xapi-lang For declarative code generation" By James Nelson"Xapi-lang For declarative code generation" By James Nelson
"Xapi-lang For declarative code generation" By James Nelson
GWTcon
 
The Beauty And The Beast Php N W09
The Beauty And The Beast Php N W09The Beauty And The Beast Php N W09
The Beauty And The Beast Php N W09
Bastian Feder
 
BaseX user-group-talk XML Prague 2013
BaseX user-group-talk XML Prague 2013BaseX user-group-talk XML Prague 2013
BaseX user-group-talk XML Prague 2013
Andy Bunce
 
XML London 2013 - Architecture of xproc.xq an XProc processor
XML London 2013 - Architecture of xproc.xq an XProc processorXML London 2013 - Architecture of xproc.xq an XProc processor
XML London 2013 - Architecture of xproc.xq an XProc processor
jimfuller2009
 
Introduction to Docker at the Azure Meet-up in New York
Introduction to Docker at the Azure Meet-up in New YorkIntroduction to Docker at the Azure Meet-up in New York
Introduction to Docker at the Azure Meet-up in New York
Jérôme Petazzoni
 
Containers: from development to production at DevNation 2015
Containers: from development to production at DevNation 2015Containers: from development to production at DevNation 2015
Containers: from development to production at DevNation 2015
Jérôme Petazzoni
 
Jdom how it works & how it opened the java process
Jdom how it works & how it opened the java processJdom how it works & how it opened the java process
Jdom how it works & how it opened the java process
Hicham QAISSI
 
UCL All of the Things (MeetBSD California 2014 Lightning Talk)
UCL All of the Things (MeetBSD California 2014 Lightning Talk)UCL All of the Things (MeetBSD California 2014 Lightning Talk)
UCL All of the Things (MeetBSD California 2014 Lightning Talk)
iXsystems
 
Introduction to Node (15th May 2017)
Introduction to Node (15th May 2017)Introduction to Node (15th May 2017)
Introduction to Node (15th May 2017)
Lucas Jellema
 
.NET @ apache.org
 .NET @ apache.org .NET @ apache.org
.NET @ apache.org
Ted Husted
 
Synapseindia dot net development web applications with ajax
Synapseindia dot net development  web applications with ajaxSynapseindia dot net development  web applications with ajax
Synapseindia dot net development web applications with ajax
Synapseindiappsdevelopment
 
I Just Want to Run My Code: Waypoint, Nomad, and Other Things
I Just Want to Run My Code: Waypoint, Nomad, and Other ThingsI Just Want to Run My Code: Waypoint, Nomad, and Other Things
I Just Want to Run My Code: Waypoint, Nomad, and Other Things
Michael Lange
 
Introduction to Docker, December 2014 "Tour de France" Edition
Introduction to Docker, December 2014 "Tour de France" EditionIntroduction to Docker, December 2014 "Tour de France" Edition
Introduction to Docker, December 2014 "Tour de France" Edition
Jérôme Petazzoni
 
Workshop : 45 minutes pour comprendre Docker avec Jérôme Petazzoni
Workshop : 45 minutes pour comprendre Docker avec Jérôme PetazzoniWorkshop : 45 minutes pour comprendre Docker avec Jérôme Petazzoni
Workshop : 45 minutes pour comprendre Docker avec Jérôme Petazzoni
TheFamily
 
The elastic stack on docker
The elastic stack on dockerThe elastic stack on docker
The elastic stack on docker
SmartWave
 

Similar to Balisage - EXPath - A practical introduction (20)

EXPath Webapp - CXAN: a case-study for Servlex, an XML web framework
EXPath Webapp - CXAN: a case-study for Servlex, an XML web frameworkEXPath Webapp - CXAN: a case-study for Servlex, an XML web framework
EXPath Webapp - CXAN: a case-study for Servlex, an XML web framework
 
TYPO3 Transition Tool
TYPO3 Transition ToolTYPO3 Transition Tool
TYPO3 Transition Tool
 
Geospatial web services using little-known GDAL features and modern Perl midd...
Geospatial web services using little-known GDAL features and modern Perl midd...Geospatial web services using little-known GDAL features and modern Perl midd...
Geospatial web services using little-known GDAL features and modern Perl midd...
 
Building bridges - Plone Conference 2015 Bucharest
Building bridges   - Plone Conference 2015 BucharestBuilding bridges   - Plone Conference 2015 Bucharest
Building bridges - Plone Conference 2015 Bucharest
 
Easy access to open stack object storage
Easy access to open stack object storageEasy access to open stack object storage
Easy access to open stack object storage
 
"Xapi-lang For declarative code generation" By James Nelson
"Xapi-lang For declarative code generation" By James Nelson"Xapi-lang For declarative code generation" By James Nelson
"Xapi-lang For declarative code generation" By James Nelson
 
The Beauty And The Beast Php N W09
The Beauty And The Beast Php N W09The Beauty And The Beast Php N W09
The Beauty And The Beast Php N W09
 
BaseX user-group-talk XML Prague 2013
BaseX user-group-talk XML Prague 2013BaseX user-group-talk XML Prague 2013
BaseX user-group-talk XML Prague 2013
 
XML London 2013 - Architecture of xproc.xq an XProc processor
XML London 2013 - Architecture of xproc.xq an XProc processorXML London 2013 - Architecture of xproc.xq an XProc processor
XML London 2013 - Architecture of xproc.xq an XProc processor
 
Introduction to Docker at the Azure Meet-up in New York
Introduction to Docker at the Azure Meet-up in New YorkIntroduction to Docker at the Azure Meet-up in New York
Introduction to Docker at the Azure Meet-up in New York
 
Containers: from development to production at DevNation 2015
Containers: from development to production at DevNation 2015Containers: from development to production at DevNation 2015
Containers: from development to production at DevNation 2015
 
Jdom how it works & how it opened the java process
Jdom how it works & how it opened the java processJdom how it works & how it opened the java process
Jdom how it works & how it opened the java process
 
UCL All of the Things (MeetBSD California 2014 Lightning Talk)
UCL All of the Things (MeetBSD California 2014 Lightning Talk)UCL All of the Things (MeetBSD California 2014 Lightning Talk)
UCL All of the Things (MeetBSD California 2014 Lightning Talk)
 
Introduction to Node (15th May 2017)
Introduction to Node (15th May 2017)Introduction to Node (15th May 2017)
Introduction to Node (15th May 2017)
 
.NET @ apache.org
 .NET @ apache.org .NET @ apache.org
.NET @ apache.org
 
Synapseindia dot net development web applications with ajax
Synapseindia dot net development  web applications with ajaxSynapseindia dot net development  web applications with ajax
Synapseindia dot net development web applications with ajax
 
I Just Want to Run My Code: Waypoint, Nomad, and Other Things
I Just Want to Run My Code: Waypoint, Nomad, and Other ThingsI Just Want to Run My Code: Waypoint, Nomad, and Other Things
I Just Want to Run My Code: Waypoint, Nomad, and Other Things
 
Introduction to Docker, December 2014 "Tour de France" Edition
Introduction to Docker, December 2014 "Tour de France" EditionIntroduction to Docker, December 2014 "Tour de France" Edition
Introduction to Docker, December 2014 "Tour de France" Edition
 
Workshop : 45 minutes pour comprendre Docker avec Jérôme Petazzoni
Workshop : 45 minutes pour comprendre Docker avec Jérôme PetazzoniWorkshop : 45 minutes pour comprendre Docker avec Jérôme Petazzoni
Workshop : 45 minutes pour comprendre Docker avec Jérôme Petazzoni
 
The elastic stack on docker
The elastic stack on dockerThe elastic stack on docker
The elastic stack on docker
 

Recently uploaded

Improving Learning Content Efficiency with Reusable Learning Content
Improving Learning Content Efficiency with Reusable Learning ContentImproving Learning Content Efficiency with Reusable Learning Content
Improving Learning Content Efficiency with Reusable Learning Content
Enterprise Knowledge
 
Opencast Summit 2024 — Opencast @ University of Münster
Opencast Summit 2024 — Opencast @ University of MünsterOpencast Summit 2024 — Opencast @ University of Münster
Opencast Summit 2024 — Opencast @ University of Münster
Matthias Neugebauer
 
Zaitechno Handheld Raman Spectrometer.pdf
Zaitechno Handheld Raman Spectrometer.pdfZaitechno Handheld Raman Spectrometer.pdf
Zaitechno Handheld Raman Spectrometer.pdf
AmandaCheung15
 
Computer HARDWARE presenattion by CWD students class 10
Computer HARDWARE presenattion by CWD students class 10Computer HARDWARE presenattion by CWD students class 10
Computer HARDWARE presenattion by CWD students class 10
ankush9927
 
Patch Tuesday de julio
Patch Tuesday de julioPatch Tuesday de julio
Patch Tuesday de julio
Ivanti
 
Girls Call Churchgate 9910780858 Provide Best And Top Girl Service And No1 in...
Girls Call Churchgate 9910780858 Provide Best And Top Girl Service And No1 in...Girls Call Churchgate 9910780858 Provide Best And Top Girl Service And No1 in...
Girls Call Churchgate 9910780858 Provide Best And Top Girl Service And No1 in...
maigasapphire
 
Russian Girls Call Navi Mumbai 🎈🔥9920725232 🔥💋🎈 Provide Best And Top Girl Ser...
Russian Girls Call Navi Mumbai 🎈🔥9920725232 🔥💋🎈 Provide Best And Top Girl Ser...Russian Girls Call Navi Mumbai 🎈🔥9920725232 🔥💋🎈 Provide Best And Top Girl Ser...
Russian Girls Call Navi Mumbai 🎈🔥9920725232 🔥💋🎈 Provide Best And Top Girl Ser...
bellared2
 
Sonkoloniya documentation - ONEprojukti.pdf
Sonkoloniya documentation - ONEprojukti.pdfSonkoloniya documentation - ONEprojukti.pdf
Sonkoloniya documentation - ONEprojukti.pdf
SubhamMandal40
 
Semantic-Aware Code Model: Elevating the Future of Software Development
Semantic-Aware Code Model: Elevating the Future of Software DevelopmentSemantic-Aware Code Model: Elevating the Future of Software Development
Semantic-Aware Code Model: Elevating the Future of Software Development
Baishakhi Ray
 
It's your unstructured data: How to get your GenAI app to production (and spe...
It's your unstructured data: How to get your GenAI app to production (and spe...It's your unstructured data: How to get your GenAI app to production (and spe...
It's your unstructured data: How to get your GenAI app to production (and spe...
Zilliz
 
leewayhertz.com-Generative AI tech stack Frameworks infrastructure models and...
leewayhertz.com-Generative AI tech stack Frameworks infrastructure models and...leewayhertz.com-Generative AI tech stack Frameworks infrastructure models and...
leewayhertz.com-Generative AI tech stack Frameworks infrastructure models and...
alexjohnson7307
 
Mule Experience Hub and Release Channel with Java 17
Mule Experience Hub and Release Channel with Java 17Mule Experience Hub and Release Channel with Java 17
Mule Experience Hub and Release Channel with Java 17
Bhajan Mehta
 
Generative AI Reasoning Tech Talk - July 2024
Generative AI Reasoning Tech Talk - July 2024Generative AI Reasoning Tech Talk - July 2024
Generative AI Reasoning Tech Talk - July 2024
siddu769252
 
Mastering OnlyFans Clone App Development: Key Strategies for Success
Mastering OnlyFans Clone App Development: Key Strategies for SuccessMastering OnlyFans Clone App Development: Key Strategies for Success
Mastering OnlyFans Clone App Development: Key Strategies for Success
David Wilson
 
kk vathada _digital transformation frameworks_2024.pdf
kk vathada _digital transformation frameworks_2024.pdfkk vathada _digital transformation frameworks_2024.pdf
kk vathada _digital transformation frameworks_2024.pdf
KIRAN KV
 
Redefining Cybersecurity with AI Capabilities
Redefining Cybersecurity with AI CapabilitiesRedefining Cybersecurity with AI Capabilities
Redefining Cybersecurity with AI Capabilities
Priyanka Aash
 
Integrating Kafka with MuleSoft 4 and usecase
Integrating Kafka with MuleSoft 4 and usecaseIntegrating Kafka with MuleSoft 4 and usecase
Integrating Kafka with MuleSoft 4 and usecase
shyamraj55
 
EuroPython 2024 - Streamlining Testing in a Large Python Codebase
EuroPython 2024 - Streamlining Testing in a Large Python CodebaseEuroPython 2024 - Streamlining Testing in a Large Python Codebase
EuroPython 2024 - Streamlining Testing in a Large Python Codebase
Jimmy Lai
 
Vulnerability Management: A Comprehensive Overview
Vulnerability Management: A Comprehensive OverviewVulnerability Management: A Comprehensive Overview
Vulnerability Management: A Comprehensive Overview
Steven Carlson
 
UX Webinar Series: Drive Revenue and Decrease Costs with Passkeys for Consume...
UX Webinar Series: Drive Revenue and Decrease Costs with Passkeys for Consume...UX Webinar Series: Drive Revenue and Decrease Costs with Passkeys for Consume...
UX Webinar Series: Drive Revenue and Decrease Costs with Passkeys for Consume...
FIDO Alliance
 

Recently uploaded (20)

Improving Learning Content Efficiency with Reusable Learning Content
Improving Learning Content Efficiency with Reusable Learning ContentImproving Learning Content Efficiency with Reusable Learning Content
Improving Learning Content Efficiency with Reusable Learning Content
 
Opencast Summit 2024 — Opencast @ University of Münster
Opencast Summit 2024 — Opencast @ University of MünsterOpencast Summit 2024 — Opencast @ University of Münster
Opencast Summit 2024 — Opencast @ University of Münster
 
Zaitechno Handheld Raman Spectrometer.pdf
Zaitechno Handheld Raman Spectrometer.pdfZaitechno Handheld Raman Spectrometer.pdf
Zaitechno Handheld Raman Spectrometer.pdf
 
Computer HARDWARE presenattion by CWD students class 10
Computer HARDWARE presenattion by CWD students class 10Computer HARDWARE presenattion by CWD students class 10
Computer HARDWARE presenattion by CWD students class 10
 
Patch Tuesday de julio
Patch Tuesday de julioPatch Tuesday de julio
Patch Tuesday de julio
 
Girls Call Churchgate 9910780858 Provide Best And Top Girl Service And No1 in...
Girls Call Churchgate 9910780858 Provide Best And Top Girl Service And No1 in...Girls Call Churchgate 9910780858 Provide Best And Top Girl Service And No1 in...
Girls Call Churchgate 9910780858 Provide Best And Top Girl Service And No1 in...
 
Russian Girls Call Navi Mumbai 🎈🔥9920725232 🔥💋🎈 Provide Best And Top Girl Ser...
Russian Girls Call Navi Mumbai 🎈🔥9920725232 🔥💋🎈 Provide Best And Top Girl Ser...Russian Girls Call Navi Mumbai 🎈🔥9920725232 🔥💋🎈 Provide Best And Top Girl Ser...
Russian Girls Call Navi Mumbai 🎈🔥9920725232 🔥💋🎈 Provide Best And Top Girl Ser...
 
Sonkoloniya documentation - ONEprojukti.pdf
Sonkoloniya documentation - ONEprojukti.pdfSonkoloniya documentation - ONEprojukti.pdf
Sonkoloniya documentation - ONEprojukti.pdf
 
Semantic-Aware Code Model: Elevating the Future of Software Development
Semantic-Aware Code Model: Elevating the Future of Software DevelopmentSemantic-Aware Code Model: Elevating the Future of Software Development
Semantic-Aware Code Model: Elevating the Future of Software Development
 
It's your unstructured data: How to get your GenAI app to production (and spe...
It's your unstructured data: How to get your GenAI app to production (and spe...It's your unstructured data: How to get your GenAI app to production (and spe...
It's your unstructured data: How to get your GenAI app to production (and spe...
 
leewayhertz.com-Generative AI tech stack Frameworks infrastructure models and...
leewayhertz.com-Generative AI tech stack Frameworks infrastructure models and...leewayhertz.com-Generative AI tech stack Frameworks infrastructure models and...
leewayhertz.com-Generative AI tech stack Frameworks infrastructure models and...
 
Mule Experience Hub and Release Channel with Java 17
Mule Experience Hub and Release Channel with Java 17Mule Experience Hub and Release Channel with Java 17
Mule Experience Hub and Release Channel with Java 17
 
Generative AI Reasoning Tech Talk - July 2024
Generative AI Reasoning Tech Talk - July 2024Generative AI Reasoning Tech Talk - July 2024
Generative AI Reasoning Tech Talk - July 2024
 
Mastering OnlyFans Clone App Development: Key Strategies for Success
Mastering OnlyFans Clone App Development: Key Strategies for SuccessMastering OnlyFans Clone App Development: Key Strategies for Success
Mastering OnlyFans Clone App Development: Key Strategies for Success
 
kk vathada _digital transformation frameworks_2024.pdf
kk vathada _digital transformation frameworks_2024.pdfkk vathada _digital transformation frameworks_2024.pdf
kk vathada _digital transformation frameworks_2024.pdf
 
Redefining Cybersecurity with AI Capabilities
Redefining Cybersecurity with AI CapabilitiesRedefining Cybersecurity with AI Capabilities
Redefining Cybersecurity with AI Capabilities
 
Integrating Kafka with MuleSoft 4 and usecase
Integrating Kafka with MuleSoft 4 and usecaseIntegrating Kafka with MuleSoft 4 and usecase
Integrating Kafka with MuleSoft 4 and usecase
 
EuroPython 2024 - Streamlining Testing in a Large Python Codebase
EuroPython 2024 - Streamlining Testing in a Large Python CodebaseEuroPython 2024 - Streamlining Testing in a Large Python Codebase
EuroPython 2024 - Streamlining Testing in a Large Python Codebase
 
Vulnerability Management: A Comprehensive Overview
Vulnerability Management: A Comprehensive OverviewVulnerability Management: A Comprehensive Overview
Vulnerability Management: A Comprehensive Overview
 
UX Webinar Series: Drive Revenue and Decrease Costs with Passkeys for Consume...
UX Webinar Series: Drive Revenue and Decrease Costs with Passkeys for Consume...UX Webinar Series: Drive Revenue and Decrease Costs with Passkeys for Consume...
UX Webinar Series: Drive Revenue and Decrease Costs with Passkeys for Consume...
 

Balisage - EXPath - A practical introduction

  • 1. EXPath A practical introduction Balisage, August 13th, 2009 Florent Georges fgeorges.org
  • 2. EXPath A practical introduction ● Introduction ← ● The project ● HTTP Client ● ZIP facility ● Packaging ● Putting it all together ● Sibling projects
  • 3. Introduction ● XPath is a textual language to navigate XDM trees ● It is used standalone or embedded in XSLT, XQuery, XProc, XForms, and other languages ● A recommendation defines a standard library of functions ● An implementation or host language can provide additional functions: the extension functions
  • 4. Introduction ● More and more demand for extensions for XSLT 2.0 and XQuery for one year ● Extension functions are the easiest way ● They are at the XPath level ● Acting at the XPath level allows them to be used in another languages ● XProc is a good example of such another language (EXProc defines also extensions for a few months)
  • 5. EXPath A practical introduction ● Introduction ● The project ← ● HTTP Client ● ZIP facility ● Packaging ● Putting it all together ● Sibling projects
  • 6. The project ● Collaborative ● The base delivery unit is the module ● The main deliverable is the specification ● Each module has its own maintainer ● Implementations as external extensions are encouraged during specification ● Independent on any particular vendor ● ...though they are welcome, of course ;-)
  • 7. The project ● Extension functions libraries ● But also: – Testing framework (based on Jeni's XSpec?) – Documentation system (based on Ken's XSLStyle?) – General-purpose packaging system – Help identifying best practices – Servlet-like container – ...
  • 8. EXPath A practical introduction ● Introduction ● The project ● HTTP Client ← ● ZIP facility ● Packaging ● Putting it all together ● Sibling projects
  • 9. HTTP Client ● Send HTTP requests and handle responses ● Based on the XProc step p:http-request ● Enable one to: – Retrieve plain resources on the web – Query REST-based Web sevices – Query SOAP-based Web services – Query Google services
  • 10. HTTP Client http:send-request($request as element(http:request)) as item()+
  • 11. HTTP Client http:send-request($request as element(http:request)) as item()+ <http:request href="http://www.example.com/..." method="post"> <http:header name="X-Header" value="some value"/> <http:body content-type="application/xml"> <hello>World!</hello> </http:body> </http:request>
  • 12. HTTP Client http:send-request($request as element(http:request)) as item()+ <http:request href="http://www.example.com/..." method="post"> <http:header name="X-Header" value="some value"/> <http:body content-type="application/xml"> <hello>World!</hello> </http:body> </http:request> <http:response status="200" message="Ok"> <http:header name="..." value="..."/> ... <http:body content-type="application/xml"/> </http:response>
  • 13. HTTP Client http:send-request( <http:request href="http://www.balisage.net/" method="get"/>) ↘ ( ? )
  • 14. HTTP Client http:send-request( <http:request href="http://www.balisage.net/" method="get"/>) ↘ ( <http:response status="200" message="OK"> <http:header name="Server" value="Apache/1.3.41 (Unix) ..."/> ... <http:body content-type="text/html"/> </http:response> , ? )
  • 15. HTTP Client http:send-request( <http:request href="http://www.balisage.net/" method="get"/>) ↘ ( <http:response status="200" message="OK"> <http:header name="Server" value="Apache/1.3.41 (Unix) ..."/> ... <http:body content-type="text/html"/> </http:response> , <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Balisage: The Markup Conference</title> ... )
  • 16. HTTP Client ● Live samples: – XQuery with Saxon, MarkLogic and eXist – Google's GData API – WSDL Compiler
  • 17. EXPath A practical introduction ● Introduction ● The project ● HTTP Client ● ZIP facility ← ● Packaging ● Putting it all together ● Sibling projects
  • 18. ZIP facility ● Read and write ZIP files – List all entries – Extract specific entries – Update existing entries – Create brand-new ZIP files ● Well suited for XML + ZIP documents (OpenDocument, Open XML, EPUB, etc.)
  • 19. ZIP facility ● List entries: – zip:entries($href) as element(zip:file) ● Extract entries: – zip:xml-entry($href, $path) as document-node() – zip:html-entry($href, $path) as document-node() – zip:text-entry($href, $path) as xs:string – zip:binary-entry($href, $path) as xs:base64Binary ● Create new ZIP files: – zip:zip-file($zip) as empty() – zip:update-entries($zip, $output) as empty()
  • 20. ZIP facility <zip:file href="some.zip" xmlns:zip="http://www.expath.org/mod/zip"> <zip:entry name="file.xml" output="xml"> <hello>World!</hello> </zip:entry> <zip:entry name="index.html" output="html" href="/some/file.html"/> <zip:dir name="dir"> <zip:entry name="file.txt" output="text"> Hello, world! </zip:entry> </zip:dir> </zip:file>
  • 21. ZIP facility ● Live samples: – List entries in a ZIP file – Extract an XML entry – Create a new file
  • 22. ZIP facility ● “Compound Document Template” pattern ● Create a new ZIP file by copying an existing one, updating and adding some entries ● For instance, you can edit a text document directly within OpenOffice, and use it as a template to format an input data document
  • 24. EXPath A practical introduction ● Introduction ● The project ● HTTP Client ● ZIP facility ● Packaging ← ● Putting it all together ● Sibling projects
  • 25. Packaging ● Support XSLT, XQuery and XProc ● Can be extended for other X* technologies ● Independent on the processor for std X* files ● Allow processor-dependent features (i.e. for Java extension functions) ● Support only deploying libraries ● Can be used as a building block for more complex frameworks, like XRX
  • 26. Packaging ● Deployment descriptor: <package xmlns="http://expath.org/mod/expath-pkg"> <module version="0.1" name="google-xslt"> <title>Simple XQuery package for tests</title> <xsl> <import-uri>http://www.fgeorges.org/google/gdata.xsl</import-uri> <file>xsl/gdata.xsl</file> </xsl> ... </module> </package>
  • 27. Packaging ● Example of use: <xsl:stylesheet xmlns:f="http://fxsl.sf.net/" version="2.0"> <xsl:import href="http://fxsl.sf.net/f/func-Fibonacci.xsl"/> <xsl:template match="/" name="main"> <fibo> <xsl:value-of select="f:fibo(10)"/> </fibo> </xsl:template> </xsl:stylesheet>
  • 29. Packaging ● Examples: – Deploy XSLT and XQuery for Saxon – Deploy Java extensions for Saxon – Deploy XQuery for eXist – Deploy Java extensions for eXist
  • 30. Packaging ● For now, use an external application to deploy ● Limited to the processor's mechanism to resolve URIs ● For some processors, not possible to deploy without changing importing stylesheets/queries ● Ideal situation: supported natively by a broad number of processors ● Is a support for other frameworks, and CXAN
  • 31. Packaging ● In XSLT <!-- the public and absolute import URI --> <xsl:import href="http://www.expath.org/mod/http-client.xsl"/> ● In XQuery? There is no convention. import module namespace http = "http://www.expath.org/mod/http-client" at "http://www.expath.org/mod/http-client.xq"; - versus - import module namespace http = "http://www.expath.org/mod/http-client";
  • 32. EXPath A practical introduction ● Introduction ● The project ● HTTP Client ● ZIP facility ● Packaging ● Putting it all together ← ● Sibling projects
  • 33. Putting it all together ● Use the HTTP Client to access various Google APIs (REST Web services): contacts, maps, ... ● Use ZIP facility and the Compound Document Template pattern ● All those libraries are accessed through the Packaging System
  • 34. Putting it all together
  • 35. EXPath A practical introduction ● Introduction ● The project ● HTTP Client ● ZIP facility ● Packaging ● Putting it all together ● Sibling projects ←
  • 36. Sibling projects ● EXQuery, EXSLT 2.0, and EXProc ● Where's the border? – EXPath Packaging system – Servlet-like container definition – Full XRX container definition
  • 37. That's all Folks! ● Plenty of other potential extensions ● More low-level and general-purpose: nested sequences and first-class function items ● Join the mailing list and browse the website: http://www.expath.org/