SlideShare uma empresa Scribd logo
1 de 38
Baixar para ler offline
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

Mais conteúdo relacionado

Mais procurados

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 scriptBill Buchan
 
Like loggly using open source
Like loggly using open sourceLike loggly using open source
Like loggly using open sourceThomas Alrin
 
M|18 Architectural Overview: MariaDB MaxScale
M|18 Architectural Overview: MariaDB MaxScaleM|18 Architectural Overview: MariaDB MaxScale
M|18 Architectural Overview: MariaDB MaxScaleMariaDB 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 ComparisonIgor Anishchenko
 
HornetQ Presentation On JBoss World 2009
HornetQ Presentation On JBoss World 2009HornetQ Presentation On JBoss World 2009
HornetQ Presentation On JBoss World 2009jarfield
 
Python mongo db-training-europython-2011
Python mongo db-training-europython-2011Python mongo db-training-europython-2011
Python mongo db-training-europython-2011Andreas Jung
 
9781305078444 ppt ch02
9781305078444 ppt ch029781305078444 ppt ch02
9781305078444 ppt ch02Terry Yoast
 
9781305078444 ppt ch04
9781305078444 ppt ch049781305078444 ppt ch04
9781305078444 ppt ch04Terry Yoast
 
NoSQL and JavaScript: a Love Story
NoSQL and JavaScript: a Love StoryNoSQL and JavaScript: a Love Story
NoSQL and JavaScript: a Love StoryAlexandre Morgaut
 
The architecture of oak
The architecture of oakThe architecture of oak
The architecture of oakMichael Dürig
 
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 KibanaPrajal 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.6Jonathan Clarke
 
Ninja Build: Simple Guide for Beginners
Ninja Build: Simple Guide for BeginnersNinja Build: Simple Guide for Beginners
Ninja Build: Simple Guide for BeginnersChang W. Doh
 
Intro to GemStone/S
Intro to GemStone/SIntro to GemStone/S
Intro to GemStone/SESUG
 

Mais procurados (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
 

Destaque (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
 

Semelhante a 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 frameworkFlorent Georges
 
TYPO3 Transition Tool
TYPO3 Transition ToolTYPO3 Transition Tool
TYPO3 Transition Toolcrus0e
 
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 BucharestAndreas 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 storageJuan 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 NelsonGWTcon
 
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 W09Bastian 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 2013Andy 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 processorjimfuller2009
 
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 YorkJé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 2015Jé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 processHicham 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.orgTed 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 ajaxSynapseindiappsdevelopment
 
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 ThingsMichael 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 PetazzoniTheFamily
 
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" EditionJérôme Petazzoni
 
The elastic stack on docker
The elastic stack on dockerThe elastic stack on docker
The elastic stack on dockerSmartWave
 

Semelhante a 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
 

Último

Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 

Último (20)

Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 

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/