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
 
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
 
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
 
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
 
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
 
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
 
The elastic stack on docker
The elastic stack on dockerThe elastic stack on docker
The elastic stack on docker
 

Recently uploaded

みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
名前 です男
 
Data structures and Algorithms in Python.pdf
Data structures and Algorithms in Python.pdfData structures and Algorithms in Python.pdf
Data structures and Algorithms in Python.pdf
TIPNGVN2
 
How to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For FlutterHow to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For Flutter
Daiki Mogmet Ito
 
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
Neo4j
 
Microsoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdfMicrosoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdf
Uni Systems S.M.S.A.
 
Building RAG with self-deployed Milvus vector database and Snowpark Container...
Building RAG with self-deployed Milvus vector database and Snowpark Container...Building RAG with self-deployed Milvus vector database and Snowpark Container...
Building RAG with self-deployed Milvus vector database and Snowpark Container...
Zilliz
 
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Speck&Tech
 
UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6
DianaGray10
 
Video Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the FutureVideo Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the Future
Alpen-Adria-Universität
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
Aftab Hussain
 
National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
Quotidiano Piemontese
 
Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1
DianaGray10
 
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
Neo4j
 
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfUnlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Malak Abu Hammad
 
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
Edge AI and Vision Alliance
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
Ana-Maria Mihalceanu
 
Large Language Model (LLM) and it’s Geospatial Applications
Large Language Model (LLM) and it’s Geospatial ApplicationsLarge Language Model (LLM) and it’s Geospatial Applications
Large Language Model (LLM) and it’s Geospatial Applications
Rohit Gautam
 
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
Neo4j
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
Safe Software
 
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionGenerative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Aggregage
 

Recently uploaded (20)

みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
 
Data structures and Algorithms in Python.pdf
Data structures and Algorithms in Python.pdfData structures and Algorithms in Python.pdf
Data structures and Algorithms in Python.pdf
 
How to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For FlutterHow to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For Flutter
 
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
 
Microsoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdfMicrosoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdf
 
Building RAG with self-deployed Milvus vector database and Snowpark Container...
Building RAG with self-deployed Milvus vector database and Snowpark Container...Building RAG with self-deployed Milvus vector database and Snowpark Container...
Building RAG with self-deployed Milvus vector database and Snowpark Container...
 
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
 
UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6
 
Video Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the FutureVideo Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the Future
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
 
National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
 
Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1
 
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
 
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfUnlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
 
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
 
Large Language Model (LLM) and it’s Geospatial Applications
Large Language Model (LLM) and it’s Geospatial ApplicationsLarge Language Model (LLM) and it’s Geospatial Applications
Large Language Model (LLM) and it’s Geospatial Applications
 
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
 
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionGenerative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to Production
 

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/