SlideShare a Scribd company logo
1 of 58
Download to read offline
‫أكاديمية الحكومة اإللكترونية الفلسطينية‬
           The Palestinian eGovernment Academy
                              www.egovacademy.ps



                              Tutorial III:
Process Integration and Service Oriented Architectures

                      Session 3
                    Xpath & Xquery
                                 Prepared By

                         Ismail Romi
           Palestine Polytechnic University (PPU)
                   Email: ismailr@ppu.edu



                                  Reviewed by
      Prof. Marco Ronchetti and Prof. Paolo 2011
                                 PalGov © Bouquet, Trento University, Italy   1
About

This tutorial is part of the PalGov project, funded by the TEMPUS IV program of the
Commission of the European Communities, grant agreement 511159-TEMPUS-1-
2010-1-PS-TEMPUS-JPHES. The project website: www.egovacademy.ps
Project Consortium:
             Birzeit University, Palestine
                                                           University of Trento, Italy
             (Coordinator )


             Palestine Polytechnic University, Palestine   Vrije Universiteit Brussel, Belgium


             Palestine Technical University, Palestine
                                                           Université de Savoie, France

             Ministry of Telecom and IT, Palestine
                                                           University of Namur, Belgium
             Ministry of Interior, Palestine
                                                           TrueTrust, UK
             Ministry of Local Government, Palestine


Coordinator:
Dr. Mustafa Jarrar
Birzeit University, P.O.Box 14- Birzeit, Palestine
Telfax:+972 2 2982935 mjarrar@birzeit.eduPalGov © 2011
                                                                                                 2
© Copyright Notes
Everyone is encouraged to use this material, or part of it, but should
properly cite the project (logo and website), and the author of that part.


No part of this tutorial may be reproduced or modified in any form or by
any means, without prior written permission from the project, who have
the full copyrights on the material.




                 Attribution-NonCommercial-ShareAlike
                              CC-BY-NC-SA

This license lets others remix, tweak, and build upon your work non-
commercially, as long as they credit you and license their new creations
under the identical terms.

                                 PalGov © 2011                               3
Tutorial Map



           Intended Learning Objectives
A: Knowledge and Understanding
                                                                                      Title                    T    Name
 3a1: Demonstrate knowledge of the fundamentals of middleware.
 3a2: Describe the concept behind web service protocols.
                                                                       Session0: Syllabus and overview         0   Aldasht
 3a3: Explain the concept of service oriented architecture.            Sesson1: Introduction to SOA            2   Aldasht
 3a4: Explain the concept of enterprise service bus.                   Session2: XML namespaces & XML schema   2   Aldasht
 3a5: Understanding WSDL service interfaces in UDDI.                   Session 3: Xpath & Xquery               4   Romi
B: Intellectual Skills                                                 Session4: REST web services             3   M. Melhem
 3b1: Design, develop, and deploy applications based on Service        Session5: Lab2: Practice on REST        3   M. Melhem
 Oriented Architecture (SOA).                                          Session 6: SOAP                         2   Aldasht
 3b2: use Business Process Execution Language (BPEL).                  Session 7: WSDL                         3   Aldasht
 3b3: using WSDL to describe web services.
                                                                       Session8: Lab 3: WSDL practice          3   Aldasht
C: Professional and Practical Skills                                   Session9: ESB                           4   Aldasht
 3c1: setup, Invoke, and deploy web services using integrated
                                                                       Session10: Lab4: Practice on ESB        4   Aldasht
 development environment.
                                                                       Session11: integration patterns         4   M. Melhem
 3c2: construct and use REST and SOAP messages for web
 services communication.                                               Session12: Lab5: integration patterns   4   M. Melhem
D: General and Transferable Skills                                     Session13: BPEL                         3   Aldasht
 d1: Working with team.                                                Session14: Lab6: Practice on BPEL       3   Aldasht
 d2: Presenting and defending ideas.                                   Session15: UDDI                         2   Aldasht
 d3: Use of creativity and innovation in problem solving.
 d4: Develop communication skills and logical reasoning abilities.


                                                                     PalGov © 2011                                             4
XPath: Content

• Ways of looking at an XML document.
• How to visualize XPath and how the component parts of XPath
  syntax fit together to enable you to navigate around the XPath
  data model.
• The XPath axes—the “directions” that are available to navigate
  around the XPath data model
• XPath 1.0 functions




                             PalGov © 2011                         5
Ways of Looking at an XML Document

• The W3C has developed three specifications:
   – XPath
   – XML Document Object Model (DOM)
   – XML Information Set
• each of which represents a logical model of an XML
  document in similar but distinct ways.




                           PalGov © 2011               6
Modeling XML Documents

1. The XPath data model:
  –    Represents most parts of a serialized XML document as a tree
       of nodes.
2. The Document Object Model:
  –    Represents an XML document as a hierarchical tree of nodes.
3. The XMLInformation Set:
  –    Represents an XMLdocument as a hierarchical tree but uses a
       different approach from both the XPath model and the DOM.
  –    The XMLInformation Set recommendation is located at
       http://www.w3.org/TR/xml-infoset/.




                             PalGov © 2011                            7
Visualizing XPath

 XPath can be considered as a street directions around the
  hierarchical tree of nodes that make up the XPath data
  model (Axes).
 XPath expressions starts from a standard point, (the root
  node).
 In XPath, the starting point is called the context.
 All legal XPath code can be called an expression.
 An XPath expression that returns a node-set is called a
  location path.




                          PalGov © 2011                       8
Visualizing Xpath …Cont

• There are 13 directions that can be used.
• In XPath, a direction is called an axis.
• Example:
   – /Book/Chapter[@number=2]




                           PalGov © 2011      9
Understanding Context

• The context indicates the location of the node where a
  processor is currently situated.
• That node is called the context node.




                           PalGov © 2011                   10
What Is a Node?

• A node is a representation in the XPath data model of a
  logical part of an XML document.
• Types:
      Root node
      Element node
      Attribut node
      Text node
      Namespace node
      Comment node
      Processing Instruction node




                                PalGov © 2011               11
Root Node

• The root node represents the document itself, independent
  of any content.
• The root node is the apex of the hierarchy of nodes that
  represents an XML document.
• It has no name and cannot be seen when the document is
  serialized.
• The root node just serves as a starting point when
  navigating the document.
• The root element, is the first element in the document and
  is a child of the root node.




                          PalGov © 2011                        12
Element Node

• Each element in an XML document is represented as an
  element node in the XPath data model.
• Element nodes have a name that consists of the
  namespace URI of the element and the local part of its
  name.
  The following is an XML document:
  <?xml version="1.0" encoding="ISO-8859-
  1"?>

  <bookstore>
   <book>                               Root Element Node
    <title lang="en"> Learning XML </title>
    <author> Ray </author>
    <year>2003</year>
   </book>
  </bookstore>                          Element Node


                               PalGov © 2011                13
Attribute Node

• Each attribute in an XML document is represented in the
  XPath model as an attribute node.
• The element node with which the attribute node is
  associated is said to be the parent node of the attribute
  node.
• Attribute nodes have a name and a value.
  Example:
  <?xml version="1.0" encoding="ISO-8859-
  1"?>
  <bookstore>
   <book>
    <title lang="en"> Learning XML </title>
    <author> Ray </author>
    <year>2003</year>
   </book>                                      Attribute Node
  </bookstore>


                                PalGov © 2011                    14
Text Node

• Text content of an element node is represented in the
  XPath data model as a text node.
• The string value of a text node is its character data.
• A text node does not have a name.
  Example:
  <?xml version="1.0" encoding="ISO-8859-
  1"?>
                                                  Text Node
  <bookstore>
   <book>
    <title lang="en"> Learning XML </title>
    <author> Ray </author>
    <year>2003</year>
   </book>
  </bookstore>



                                  PalGov © 2011               15
Namespace Node

• Although a specific node can only belong to one
  namespace.
• Any number of in-scope namespaces can be in effect for
  the node.
• In-scope namespaces are those for which there exists a
  valid prefix to URI mapping or where a URI is associated
  with an empty prefix, the default namespace.
  The following is an XML document:
  <?xml version="1.0" encoding="ISO-8859-
  1"?>
                                              Namespace Node
  <bookstore>
   <book>
    <title lang="en"> Learning XML </title>
    <ppu:author> Ray </author>
    <year>2003</year>
   </book>
  </bookstore>
                                  PalGov © 2011                16
Comment Node

• A comment node represents a comment in the XML
  document.
• Comments in the document type declaration are not
  represented in the XPath data model.

  Example:
  <?xml version="1.0" encoding="ISO-8859-
  1"?>
                                                  Comment Node
  <bookstore>
  <!-- This is An Example -->
   <book>
    <title lang="en"> Learning XML </title>
    <author> Ray </author>
    <year>2003</year>
   </book>
  </bookstore>


                                  PalGov © 2011                  17
Processing Instruction Node (PI)

• A processing instruction node in the XPath model
  represents a processing instruction in the corresponding
  XML document.
• The name of a processing instruction node is its target.
• The string value of a processing instruction node is its
  content, excluding the target.
• Example Of PI’s:
•For MS Word 2003 the PI situated right after the XML
declaration looks like this:
   <?mso-application progid="Word.Document"?>
•For MS Excel 2003 the PI looks like this:
   <?mso-application progid="Excel.Sheet"?>


                            PalGov © 2011                    18
Location Paths

• An expression that specifies how to navigate an XPath tree
  from one node to another.
• A location path is composed of location steps, each of
  which is composed of:
   – An “axis,”
   – A “node test”
   – An optional “predicate.”
• To locate a specific node in an XML document, we put
  together multiple location steps, each of which refines the
  search.




                                PalGov © 2011                   19
XPath 1.0 Axes
Axis Name            Ordering   Description

self                 none       The context node itself.
parent               reverse    The context node’s parent, if one exists.
child                forward    The context node’s children, if they exist.
ancestor             reverse    The context node’s ancestors, if they exist.
ancestor-or-self     reverse    The context node’s ancestors and also itself.
descendant           forward    The context node’s descendants.
descendant-or-self   forward    The context node’s descendants and also itself.

following            forward    The nodes in the XML document following the
                                context node, not including descendants.
following-sibling    forward    The sibling nodes following the context node.
preceding            reverse    The nodes in the XML document preceding the
                                context node, not including ancestors.
preceding-sibling    reverse    The sibling nodes preceding the context node.

attribute            forward    The attribute nodes of the context node.
namespace            forward    The namespace nodes of the context node.


                                   PalGov © 2011                                  20
Parent Axis

• Each element and attribute has one parent.
• Example
    <book>
      <title>Harry Potter</title>
      <author>J K. Rowling</author>
      <year>2005</year>
      <price>29.99</price>
     </book>
   – book element is the parent of the title, author, year, and price:




                              PalGov © 2011                              21
Child Axis

• Element nodes may have zero, one or more children.
• Example
    <book>
       <title>Harry Potter</title>
       <author>J K. Rowling</author>
       <year>2005</year>
       <price>29.99</price>
     </book>
   – title, author, year, and price elements are all children of the book
     element:




                              PalGov © 2011                            22
Siblings

• Nodes that have the same parent.
• Example:
  <book>
   <title>Harry Potter</title>
   <author>J K. Rowling</author>
   <year>2005</year>
   <price>29.99</price>
  </book>
   – title, author, year, and price elements are all siblings.




                              PalGov © 2011                      23
Ancestors

• Node's parent, parent's parent, etc.
• Example:
    <bookstore>
     <book>
      <title>Harry Potter</title>
      <author>J K. Rowling</author>
      <year>2005</year>
      <price>29.99</price>
     </book>
     </bookstore>
   – The ancestors of the title element are the book element and the
     bookstore element.




                               PalGov © 2011                           24
Descendants

• A node's children, children's children, etc.
• Example:
    <bookstore>
     <book>
      <title>Harry Potter</title>
      <author>J K. Rowling</author>
      <year>2005</year>
      <price>29.99</price>
     </book>
     </bookstore>
   – Descendants of the bookstore element are the book, title, author,
     year, and price elements.




                             PalGov © 2011                               25
Location Path Expression

• An XPath expression returns either a node-set, a string,
  a Boolean, or a number.
• A location path can be absolute or relative.
   – An absolute location path starts with a slash ( / )
   – A relative location path does not.
• In both cases the location path consists of one or more
  steps.
•   Examples:
• An absolute location path:
  /step/step/...
• A relative location path:
  step/step/...

                           PalGov © 2011                     26
Location Path Expression…Cont

• The syntax for a location step is:

   axisname::nodetest[predicate]




                            PalGov © 2011   27
Location Path Expression…Cont

• Example:
  <?xml version="1.0" encoding="ISO-8859-1"?>
    …………
   …………
  <bookstore>
     <book>
      <title lang="en">Harry Potter</title>
      <author>J K. Rowling</author>
      <year>2005</year>
      <price>29.99</price>
     </book>
    </bookstore>




                          PalGov © 2011         28
Location Path Expression…Cont
           axisname::nodetest[predicate]
Example                 Result
child::book             Selects all book nodes that are children of the
                        current node
attribute::lang         Selects the lang attribute of the current node
child::*                Selects all children of the current node
attribute::*            Selects all attributes of the current node
child::text()           Selects all text child nodes of the current node
child::node()           Selects all child nodes of the current node
descendant::book        Selects all book descendants of the current
                        node
ancestor::book          Selects all book ancestors of the current node
ancestor-or-            Selects all book ancestors of the current node
self::book              - and the current as well if it is a book node
child::*/child::price   Selects all price grandchildren of the current
                        node

                                  PalGov © 2011                            29
Location Path Expression…Cont
     Node Test       Description

     *               Selects all nodes of
                     the same principal node
                     type.
     node()          Selects all nodes,
                     regardless of their
                     type.
     text()          Selects all text nodes.
     comment()       Selects all comment
                     nodes.
     processing-     Selects all processing-
     instruction()   instruction nodes.
     node name       Selects all nodes with
                     the specified node
                     name.

Steps Operators:
slash (/)Separates location steps.
double-slash (//)Abbreviation for the location path
                           PalGov © 2011               30
Xpath Operators
Operator           Description                     Example                  Return value
  |      Performs the union of two node- //book | //cd              Returns a node-set with all
         sets                                                       book and cd elements
 +      Addition                        6+4                         10
  -     Subtraction                     6-4                         2
  *     Multiplication                  6*4                         24
 div    Division                        8 div 4                     2
  =     Equal                           price=9.80                  true if price is 9.80

 !=     Not equal                       price!=9.80                 false if price is 9.80

 <      Less than                       price<9.80                  true if price is 9.00
 <=     Less than or equal to           price<=9.80                 true if price is 9.00
 >      Greater than                    price>9.80                  true if price is 9.90

 >=     Greater than or equal to        price>=9.80                 true if price is 9.90
 or     or                              price=9.80 or price=9.70    true if price is 9.80
and     and                             price>9.00 and price<9.90 true if price is 9.80

mod     Modulus (division remainder)    5 mod 2                     1

                                        PalGov © 2011                                        31
node-set functions…Examples

Node-set Functions          Description

last()                      Returns the last node in the node-set.

position()                  Returns the position number of the current
                            node in the node-set being tested.
count( node-set )           Returns the number of nodes in node-set.
id( string )                Returns the element node whose ID attribute
                            matches the value specified by argument
                            string.
local-name( node-set )      Returns the local part of the expanded-name
                            for the first node in node-set.
namespace-uri( node-set )   Returns the namespace URI of the expanded-
                            name for the first node in node-set.
name( node-set )            Returns the qualified name for the first
                            node in node-set.




                               PalGov © 2011                              32
Examples

• head/title[ last() ]
   – select the last title element node contained in the head element
     node
• book[ position() = 3 ]
   – select the third book element of the context node. The location
     path
   – ……
   – …..




                             PalGov © 2011                              33
Databases: Xquery (the XML Query Language)

•   Why XQuery was created.
•   How to get started with Xquery.
•   How to query an XMLdocument using Xquery.
•   XQuery data model.
•   XQuery functions.




                           PalGov © 2011           34
XQuery

• XQuery is to XML what SQL is to database tables.
• XQuery is designed to query XML data - not just XML
  files, but anything that can appear as XML, including
  databases.
• Xquery is designed around a data model that has the
  property to be serialized as XML.
• XML data requires many of the features already
  available in DBMS (indexing, security….).
• XQuery is compatible with several W3C standards,
  such as XML, Namespaces, XSLT, XPath, and XML
  Schema.
• XQuery 1.0 became a W3C Recommendation January
  23, 2007.
                         PalGov © 2011                    35
XQuery Tools

• XQuery is still relatively new.
• A large number of software companies and
  independent developers have developed partial or
  more complete implementations of XQuery.
• W3C updates a web page where links to XQuery
  implementations and other sources of useful
  XQuery information are included
  (www.w3.org/XML/Query).




                     PalGov © 2011              36
XQuery Tools…Cont

Example:
• Saxon Xquery engine.
• X-Hive Database
• Tamino Database
• Microsoft SQL Server 2005
• Oracle
• Stylus Stodio




                       PalGov © 2011   37
XQuery - Examples of Use

• XQuery can be used to:
  –   Extract information to use in a Web Service
  –   Generate summary reports
  –   Transform XML data to XHTML
  –   Search Web documents for relevant information




                         PalGov © 2011                38
Extracting Data From XML Document
• Open the xml document:
  – The doc() function is used to open the xml
    document.
• Path Expressions:
  – XQuery uses path expressions to navigate through
    elements in an XML document.
• Predicates:
  – XQuery uses predicates to limit the extracted data
    from XML documents.
• Functions:
  – XQuery uses functions to extract data from XML
    documents.
                         PalGov © 2011                   39
doc() Function

• Used to open the XML document.
• Exampl books.xml
• Retrieving the previous document:
   – doc(books.xml)
• Retrieving part of the document:
   – You have to use the Xpath expressions.
   – doc("books.xml")/bookstore/book/title




                            PalGov © 2011     40
Predicates

• XQuery uses predicates to limit the extracted data from
  XML documents.
• Example:
   – doc("books.xml")/bookstore/book[price<30]




                              PalGov © 2011                 41
XQuery Basic Syntax Rules

• XQuery is case-sensitive
• XQuery elements, attributes, and variables must
  be valid XML names
• An XQuery string value can be in single or double
  quotes
• An XQuery variable is defined with a $ followed by
  a name, e.g. $bookstore
• XQuery comments are delimited by (: and :)
• Example:
  (: XQuery Comment :)

                         PalGov © 2011                 42
XQuery FLWOR Expressions
    (for, let, where, order by, return)
• for clause selects all elements.
• where clause selects only elements with a specified
  predicate.
• order by clause defines the sort-order.
• return clause specifies what should be returned.
• let clause allows variable assignments.




                         PalGov © 2011                  43
for , return expressions

• Used for looping
• Example:
   for $x in doc("books.xml")/bookstore/book
   return $x/title
• This for:
   – loops all bookstore/book
   – returns the title element
• $x: variable name




                                 PalGov © 2011   44
Filtering with where clause

• where used in for expression to filter the returned values.
• Example:
     for $x in doc("books.xml")/bookstore/book
      where $x/price>30
      return $x/title




                               PalGov © 2011                    45
Sorting using order by clause

• Used to sort the output in a specified order.
• Example:
     for $x in doc("books.xml")/bookstore/book
      where $x/price>30
      order by $x/title
      return $x/title




                             PalGov © 2011        46
The let Clause

• The let clause:
  – allows variable assignments
  – avoids repeating the same expression many times.
  – does not result in iteration.
• Example:
     let $x := "Ahmad"
    return <name>{$x}</name>
Output:
  <name> Ahmad </name>




                         PalGov © 2011                 47
If-Then-Else
• An XQuery Conditional Expressions.
• Example:
     for $x in doc("books.xml")/bookstore/book
     return if ($x/@category="CHILDREN")
               then <child>{data($x/title)}</child>
               else <adult>{data($x/title)}</adult>
• Notes:
   – $x: refers to variable name x
   – @ refers to an attribute
   – parentheses around the if expression are required.
   – else is required, but it can be just else ().


                           PalGov © 2011                  48
XQuery Adding Elements and Attributes

•  You can add elements and attributes to the output
  document.
Example:
  for $x in doc("books.xml")/bookstore/book/title
  return $x, <name> ali </name>
• This example adds name element to the output stream.




                        PalGov © 2011                    49
Xquery Functions

• XQuery includes over 100 built-in functions.
• There are functions for string values, numeric
  values, date and time comparison, node and
  QName manipulation, sequence manipulation,
  Boolean values, and more.
• Functions found in the w3c web site:
  www.w3.org/tr/xpath-functions




                     PalGov © 2011                 50
Examples of built-in Function

<name>{uppercase($booktitle)}</name>

for $x in doc("books.xml")/bookstore/book
order by $x/title
return $x/data(title)

Note: you have to practice w3c Xquery functions.




                         PalGov © 2011             51
Xquery and HTML

• You can generate an HTML document using Xquery.
• You can add elements
• You can add attribute.




                      PalGov © 2011                 52
Example1:

Xquery expression:
<ul>
   {
   for $x in doc("books.xml")/bookstore/book/title
   order by $x
   return <li>{$x}</li>
   }
   </ul>
Output:
<ul>
   <li><title   lang="en">Everyday Italian</title></li>
   <li><title   lang="en">Harry Potter</title></li>
   <li><title   lang="en">Learning XML</title></li>
   <li><title   lang="en">XQuery Kick Start</title></li>
   </ul>

                                   PalGov © 2011           53
Example2
• Xquery expression:
  <ul>
  {
  for $x in doc("books.xml")/bookstore/book/title
  order by $x
  return <li>{data($x)}</li>
  }
  </ul>
• Out put / HTML
  <ul>
  <li>Everyday Italian</li>
  <li>Harry Potter</li>
  <li>Learning XML</li>
  <li>XQuery Kick Start</li>
  </ul>

                               PalGov © 2011        54
Example 3

• Xquery:
<html>
   <body>

  <h1>Bookstore</h1>

  <ul>
  {
  for $x in doc("books.xml")/bookstore/book
  order by $x/title
  return <li>{data($x/title)}. Category: {data($x/@category)}</li>
  }
  </ul>

  </body>
  </html>
                                PalGov © 2011                        55
Example 3….Cont

•   Out put:
    <html>
    <body>

    <h1>Bookstore</h1>

    <ul>
    <li>Everyday Italian. Category: COOKING</li>
    <li>Harry Potter. Category: CHILDREN</li>
    <li>Learning XML. Category: WEB</li>
    <li>XQuery Kick Start. Category: WEB</li>
    </ul>

    </body>
    </html>


                              PalGov © 2011        56
References

1. Hunter, H, Rafter, J., Fawcett, J., Vlist, E., Ayers, D., Duckett, J., Watt, A.,
   McKinnon,L., (2007), "Beginning XML", 4th Ed.,Wiley Publishing Inc: Indiana, USA.
2. Ray, E., (2003), "Learning XML", 2nd Ed., O’Rreilly Media Inc.: USA.
3. http://www.w3.org
4. http://www.w3schools.com
5. http://www.xml.com
6. http://www.xml.org




                                    PalGov © 2011                                      57
Thanks
Ismail Romi




  PalGov © 2011   58

More Related Content

What's hot

Pal gov.tutorial2.session9.lab rdf-stores
Pal gov.tutorial2.session9.lab rdf-storesPal gov.tutorial2.session9.lab rdf-stores
Pal gov.tutorial2.session9.lab rdf-stores
Mustafa Jarrar
 
Pal gov.tutorial2.session10.sparql
Pal gov.tutorial2.session10.sparqlPal gov.tutorial2.session10.sparql
Pal gov.tutorial2.session10.sparql
Mustafa Jarrar
 
Pal gov.tutorial3.session6.soap
Pal gov.tutorial3.session6.soapPal gov.tutorial3.session6.soap
Pal gov.tutorial3.session6.soap
Mustafa Jarrar
 
Pal gov.tutorial2.session11.oracle
Pal gov.tutorial2.session11.oraclePal gov.tutorial2.session11.oracle
Pal gov.tutorial2.session11.oracle
Mustafa Jarrar
 
Pal gov.tutorial2.session12 1.the problem of data integration
Pal gov.tutorial2.session12 1.the problem of data integrationPal gov.tutorial2.session12 1.the problem of data integration
Pal gov.tutorial2.session12 1.the problem of data integration
Mustafa Jarrar
 
Pal gov.tutorial2.session15 1.linkeddata
Pal gov.tutorial2.session15 1.linkeddataPal gov.tutorial2.session15 1.linkeddata
Pal gov.tutorial2.session15 1.linkeddata
Mustafa Jarrar
 
Pal gov.tutorial2.session16.lab rd-fa
Pal gov.tutorial2.session16.lab rd-faPal gov.tutorial2.session16.lab rd-fa
Pal gov.tutorial2.session16.lab rd-fa
Mustafa Jarrar
 
Pal gov.tutorial2.session13 2.gav and lav integration
Pal gov.tutorial2.session13 2.gav and lav integrationPal gov.tutorial2.session13 2.gav and lav integration
Pal gov.tutorial2.session13 2.gav and lav integration
Mustafa Jarrar
 
Pal gov.tutorial2.session14.lab rdf-dataintegration
Pal gov.tutorial2.session14.lab rdf-dataintegrationPal gov.tutorial2.session14.lab rdf-dataintegration
Pal gov.tutorial2.session14.lab rdf-dataintegration
Mustafa Jarrar
 
Pal gov.tutorial2.session8.lab owl
Pal gov.tutorial2.session8.lab owlPal gov.tutorial2.session8.lab owl
Pal gov.tutorial2.session8.lab owl
Mustafa Jarrar
 
Pal gov.tutorial2.session13 3.data integration and fusion using rdf
Pal gov.tutorial2.session13 3.data integration and fusion using rdfPal gov.tutorial2.session13 3.data integration and fusion using rdf
Pal gov.tutorial2.session13 3.data integration and fusion using rdf
Mustafa Jarrar
 
Pal gov.tutorial2.session4.lab xml document and schemas
Pal gov.tutorial2.session4.lab xml  document and schemasPal gov.tutorial2.session4.lab xml  document and schemas
Pal gov.tutorial2.session4.lab xml document and schemas
Mustafa Jarrar
 
Pal gov.tutorial2.session5 2.rdfs_jarrar
Pal gov.tutorial2.session5 2.rdfs_jarrarPal gov.tutorial2.session5 2.rdfs_jarrar
Pal gov.tutorial2.session5 2.rdfs_jarrar
Mustafa Jarrar
 
Pal gov.tutorial2.session0.outline
Pal gov.tutorial2.session0.outlinePal gov.tutorial2.session0.outline
Pal gov.tutorial2.session0.outline
Mustafa Jarrar
 
Xml session04
Xml session04Xml session04
Xml session04
Niit Care
 
Abstract
AbstractAbstract
Abstract
butest
 
Lecture Notes in Computer Science:
Lecture Notes in Computer Science:Lecture Notes in Computer Science:
Lecture Notes in Computer Science:
butest
 

What's hot (20)

Pal gov.tutorial2.session9.lab rdf-stores
Pal gov.tutorial2.session9.lab rdf-storesPal gov.tutorial2.session9.lab rdf-stores
Pal gov.tutorial2.session9.lab rdf-stores
 
Pal gov.tutorial2.session10.sparql
Pal gov.tutorial2.session10.sparqlPal gov.tutorial2.session10.sparql
Pal gov.tutorial2.session10.sparql
 
Pal gov.tutorial3.session6.soap
Pal gov.tutorial3.session6.soapPal gov.tutorial3.session6.soap
Pal gov.tutorial3.session6.soap
 
Pal gov.tutorial2.session11.oracle
Pal gov.tutorial2.session11.oraclePal gov.tutorial2.session11.oracle
Pal gov.tutorial2.session11.oracle
 
Pal gov.tutorial2.session12 1.the problem of data integration
Pal gov.tutorial2.session12 1.the problem of data integrationPal gov.tutorial2.session12 1.the problem of data integration
Pal gov.tutorial2.session12 1.the problem of data integration
 
Pal gov.tutorial2.session15 1.linkeddata
Pal gov.tutorial2.session15 1.linkeddataPal gov.tutorial2.session15 1.linkeddata
Pal gov.tutorial2.session15 1.linkeddata
 
Pal gov.tutorial2.session16.lab rd-fa
Pal gov.tutorial2.session16.lab rd-faPal gov.tutorial2.session16.lab rd-fa
Pal gov.tutorial2.session16.lab rd-fa
 
Pal gov.tutorial2.session13 2.gav and lav integration
Pal gov.tutorial2.session13 2.gav and lav integrationPal gov.tutorial2.session13 2.gav and lav integration
Pal gov.tutorial2.session13 2.gav and lav integration
 
Pal gov.tutorial2.session14.lab rdf-dataintegration
Pal gov.tutorial2.session14.lab rdf-dataintegrationPal gov.tutorial2.session14.lab rdf-dataintegration
Pal gov.tutorial2.session14.lab rdf-dataintegration
 
Pal gov.tutorial2.session8.lab owl
Pal gov.tutorial2.session8.lab owlPal gov.tutorial2.session8.lab owl
Pal gov.tutorial2.session8.lab owl
 
Pal gov.tutorial2.session13 3.data integration and fusion using rdf
Pal gov.tutorial2.session13 3.data integration and fusion using rdfPal gov.tutorial2.session13 3.data integration and fusion using rdf
Pal gov.tutorial2.session13 3.data integration and fusion using rdf
 
Pal gov.tutorial2.session4.lab xml document and schemas
Pal gov.tutorial2.session4.lab xml  document and schemasPal gov.tutorial2.session4.lab xml  document and schemas
Pal gov.tutorial2.session4.lab xml document and schemas
 
Pal gov.tutorial2.session5 2.rdfs_jarrar
Pal gov.tutorial2.session5 2.rdfs_jarrarPal gov.tutorial2.session5 2.rdfs_jarrar
Pal gov.tutorial2.session5 2.rdfs_jarrar
 
Pal gov.tutorial2.session0.outline
Pal gov.tutorial2.session0.outlinePal gov.tutorial2.session0.outline
Pal gov.tutorial2.session0.outline
 
Java pdf
Java   pdfJava   pdf
Java pdf
 
Xml session04
Xml session04Xml session04
Xml session04
 
Abstract
AbstractAbstract
Abstract
 
Lecture Notes in Computer Science:
Lecture Notes in Computer Science:Lecture Notes in Computer Science:
Lecture Notes in Computer Science:
 
XML Technologies for RESTful Services Development
XML Technologies for RESTful Services DevelopmentXML Technologies for RESTful Services Development
XML Technologies for RESTful Services Development
 
M.c.a. (sem iv)- java programming
M.c.a. (sem   iv)- java programmingM.c.a. (sem   iv)- java programming
M.c.a. (sem iv)- java programming
 

Similar to Pal gov.tutorial3.session3.xpath & xquery (lab1)

Pal gov.tutorial3.session7
Pal gov.tutorial3.session7Pal gov.tutorial3.session7
Pal gov.tutorial3.session7
Mustafa Jarrar
 
Pal gov.tutorial2.session12 2.architectural solutions for the integration issues
Pal gov.tutorial2.session12 2.architectural solutions for the integration issuesPal gov.tutorial2.session12 2.architectural solutions for the integration issues
Pal gov.tutorial2.session12 2.architectural solutions for the integration issues
Mustafa Jarrar
 
Pal gov.tutorial3.session14.lab6
Pal gov.tutorial3.session14.lab6Pal gov.tutorial3.session14.lab6
Pal gov.tutorial3.session14.lab6
Mustafa Jarrar
 
Pal gov.tutorial3.session5.lab2
Pal gov.tutorial3.session5.lab2Pal gov.tutorial3.session5.lab2
Pal gov.tutorial3.session5.lab2
Mustafa Jarrar
 
Pal gov.tutorial3.session12.lab5
Pal gov.tutorial3.session12.lab5Pal gov.tutorial3.session12.lab5
Pal gov.tutorial3.session12.lab5
Mustafa Jarrar
 
Pal gov.tutorial3.session0.outline
Pal gov.tutorial3.session0.outlinePal gov.tutorial3.session0.outline
Pal gov.tutorial3.session0.outline
Mustafa Jarrar
 
Pal gov.tutorial3.session10.lab4
Pal gov.tutorial3.session10.lab4Pal gov.tutorial3.session10.lab4
Pal gov.tutorial3.session10.lab4
Mustafa Jarrar
 
Pal gov.tutorial2.session13 1.data schema integration
Pal gov.tutorial2.session13 1.data schema integrationPal gov.tutorial2.session13 1.data schema integration
Pal gov.tutorial2.session13 1.data schema integration
Mustafa Jarrar
 
Pal gov.tutorial3.session13.bpel
Pal gov.tutorial3.session13.bpelPal gov.tutorial3.session13.bpel
Pal gov.tutorial3.session13.bpel
Mustafa Jarrar
 
Pal gov.tutorial3.session1.soa
Pal gov.tutorial3.session1.soaPal gov.tutorial3.session1.soa
Pal gov.tutorial3.session1.soa
Mustafa Jarrar
 
Pal gov.tutorial3.session11.integration.patterns
Pal gov.tutorial3.session11.integration.patternsPal gov.tutorial3.session11.integration.patterns
Pal gov.tutorial3.session11.integration.patterns
Mustafa Jarrar
 
Pal gov.tutorial3.session4.rest
Pal gov.tutorial3.session4.restPal gov.tutorial3.session4.rest
Pal gov.tutorial3.session4.rest
Mustafa Jarrar
 
Pal gov.tutorial3.session8.lab3
Pal gov.tutorial3.session8.lab3Pal gov.tutorial3.session8.lab3
Pal gov.tutorial3.session8.lab3
Mustafa Jarrar
 
Pal gov.tutorial3.session9.esb
Pal gov.tutorial3.session9.esbPal gov.tutorial3.session9.esb
Pal gov.tutorial3.session9.esb
Mustafa Jarrar
 
Introductionto Xm Lmessaging
Introductionto Xm LmessagingIntroductionto Xm Lmessaging
Introductionto Xm Lmessaging
LiquidHub
 
Pal gov.tutorial3.session15.uddi
Pal gov.tutorial3.session15.uddiPal gov.tutorial3.session15.uddi
Pal gov.tutorial3.session15.uddi
Mustafa Jarrar
 
Pal gov.tutorial4.session1 1.needforsharedsemantics
Pal gov.tutorial4.session1 1.needforsharedsemanticsPal gov.tutorial4.session1 1.needforsharedsemantics
Pal gov.tutorial4.session1 1.needforsharedsemantics
Mustafa Jarrar
 

Similar to Pal gov.tutorial3.session3.xpath & xquery (lab1) (17)

Pal gov.tutorial3.session7
Pal gov.tutorial3.session7Pal gov.tutorial3.session7
Pal gov.tutorial3.session7
 
Pal gov.tutorial2.session12 2.architectural solutions for the integration issues
Pal gov.tutorial2.session12 2.architectural solutions for the integration issuesPal gov.tutorial2.session12 2.architectural solutions for the integration issues
Pal gov.tutorial2.session12 2.architectural solutions for the integration issues
 
Pal gov.tutorial3.session14.lab6
Pal gov.tutorial3.session14.lab6Pal gov.tutorial3.session14.lab6
Pal gov.tutorial3.session14.lab6
 
Pal gov.tutorial3.session5.lab2
Pal gov.tutorial3.session5.lab2Pal gov.tutorial3.session5.lab2
Pal gov.tutorial3.session5.lab2
 
Pal gov.tutorial3.session12.lab5
Pal gov.tutorial3.session12.lab5Pal gov.tutorial3.session12.lab5
Pal gov.tutorial3.session12.lab5
 
Pal gov.tutorial3.session0.outline
Pal gov.tutorial3.session0.outlinePal gov.tutorial3.session0.outline
Pal gov.tutorial3.session0.outline
 
Pal gov.tutorial3.session10.lab4
Pal gov.tutorial3.session10.lab4Pal gov.tutorial3.session10.lab4
Pal gov.tutorial3.session10.lab4
 
Pal gov.tutorial2.session13 1.data schema integration
Pal gov.tutorial2.session13 1.data schema integrationPal gov.tutorial2.session13 1.data schema integration
Pal gov.tutorial2.session13 1.data schema integration
 
Pal gov.tutorial3.session13.bpel
Pal gov.tutorial3.session13.bpelPal gov.tutorial3.session13.bpel
Pal gov.tutorial3.session13.bpel
 
Pal gov.tutorial3.session1.soa
Pal gov.tutorial3.session1.soaPal gov.tutorial3.session1.soa
Pal gov.tutorial3.session1.soa
 
Pal gov.tutorial3.session11.integration.patterns
Pal gov.tutorial3.session11.integration.patternsPal gov.tutorial3.session11.integration.patterns
Pal gov.tutorial3.session11.integration.patterns
 
Pal gov.tutorial3.session4.rest
Pal gov.tutorial3.session4.restPal gov.tutorial3.session4.rest
Pal gov.tutorial3.session4.rest
 
Pal gov.tutorial3.session8.lab3
Pal gov.tutorial3.session8.lab3Pal gov.tutorial3.session8.lab3
Pal gov.tutorial3.session8.lab3
 
Pal gov.tutorial3.session9.esb
Pal gov.tutorial3.session9.esbPal gov.tutorial3.session9.esb
Pal gov.tutorial3.session9.esb
 
Introductionto Xm Lmessaging
Introductionto Xm LmessagingIntroductionto Xm Lmessaging
Introductionto Xm Lmessaging
 
Pal gov.tutorial3.session15.uddi
Pal gov.tutorial3.session15.uddiPal gov.tutorial3.session15.uddi
Pal gov.tutorial3.session15.uddi
 
Pal gov.tutorial4.session1 1.needforsharedsemantics
Pal gov.tutorial4.session1 1.needforsharedsemanticsPal gov.tutorial4.session1 1.needforsharedsemantics
Pal gov.tutorial4.session1 1.needforsharedsemantics
 

More from Mustafa Jarrar

Habash: Arabic Natural Language Processing
Habash: Arabic Natural Language ProcessingHabash: Arabic Natural Language Processing
Habash: Arabic Natural Language Processing
Mustafa Jarrar
 
Adnan: Introduction to Natural Language Processing
Adnan: Introduction to Natural Language Processing Adnan: Introduction to Natural Language Processing
Adnan: Introduction to Natural Language Processing
Mustafa Jarrar
 
Jarrar: Sparql Project
Jarrar: Sparql ProjectJarrar: Sparql Project
Jarrar: Sparql Project
Mustafa Jarrar
 

More from Mustafa Jarrar (20)

Clustering Arabic Tweets for Sentiment Analysis
Clustering Arabic Tweets for Sentiment AnalysisClustering Arabic Tweets for Sentiment Analysis
Clustering Arabic Tweets for Sentiment Analysis
 
Classifying Processes and Basic Formal Ontology
Classifying Processes  and Basic Formal OntologyClassifying Processes  and Basic Formal Ontology
Classifying Processes and Basic Formal Ontology
 
Discrete Mathematics Course Outline
Discrete Mathematics Course OutlineDiscrete Mathematics Course Outline
Discrete Mathematics Course Outline
 
Business Process Implementation
Business Process ImplementationBusiness Process Implementation
Business Process Implementation
 
Business Process Design and Re-engineering
Business Process Design and Re-engineeringBusiness Process Design and Re-engineering
Business Process Design and Re-engineering
 
BPMN 2.0 Analytical Constructs
BPMN 2.0 Analytical ConstructsBPMN 2.0 Analytical Constructs
BPMN 2.0 Analytical Constructs
 
BPMN 2.0 Descriptive Constructs
BPMN 2.0 Descriptive Constructs  BPMN 2.0 Descriptive Constructs
BPMN 2.0 Descriptive Constructs
 
Introduction to Business Process Management
Introduction to Business Process ManagementIntroduction to Business Process Management
Introduction to Business Process Management
 
Customer Complaint Ontology
Customer Complaint Ontology Customer Complaint Ontology
Customer Complaint Ontology
 
Subset, Equality, and Exclusion Rules
Subset, Equality, and Exclusion RulesSubset, Equality, and Exclusion Rules
Subset, Equality, and Exclusion Rules
 
Schema Modularization in ORM
Schema Modularization in ORMSchema Modularization in ORM
Schema Modularization in ORM
 
On Computer Science Trends and Priorities in Palestine
On Computer Science Trends and Priorities in PalestineOn Computer Science Trends and Priorities in Palestine
On Computer Science Trends and Priorities in Palestine
 
Lessons from Class Recording & Publishing of Eight Online Courses
Lessons from Class Recording & Publishing of Eight Online CoursesLessons from Class Recording & Publishing of Eight Online Courses
Lessons from Class Recording & Publishing of Eight Online Courses
 
Presentation curras paper-emnlp2014-final
Presentation curras paper-emnlp2014-finalPresentation curras paper-emnlp2014-final
Presentation curras paper-emnlp2014-final
 
Jarrar: Future Internet in Horizon 2020 Calls
Jarrar: Future Internet in Horizon 2020 CallsJarrar: Future Internet in Horizon 2020 Calls
Jarrar: Future Internet in Horizon 2020 Calls
 
Habash: Arabic Natural Language Processing
Habash: Arabic Natural Language ProcessingHabash: Arabic Natural Language Processing
Habash: Arabic Natural Language Processing
 
Adnan: Introduction to Natural Language Processing
Adnan: Introduction to Natural Language Processing Adnan: Introduction to Natural Language Processing
Adnan: Introduction to Natural Language Processing
 
Riestra: How to Design and engineer Competitive Horizon 2020 Proposals
Riestra: How to Design and engineer Competitive Horizon 2020 ProposalsRiestra: How to Design and engineer Competitive Horizon 2020 Proposals
Riestra: How to Design and engineer Competitive Horizon 2020 Proposals
 
Bouquet: SIERA Workshop on The Pillars of Horizon2020
Bouquet: SIERA Workshop on The Pillars of Horizon2020Bouquet: SIERA Workshop on The Pillars of Horizon2020
Bouquet: SIERA Workshop on The Pillars of Horizon2020
 
Jarrar: Sparql Project
Jarrar: Sparql ProjectJarrar: Sparql Project
Jarrar: Sparql Project
 

Recently uploaded

Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
ZurliaSoop
 
Spellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseSpellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please Practise
AnaAcapella
 

Recently uploaded (20)

FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
Single or Multiple melodic lines structure
Single or Multiple melodic lines structureSingle or Multiple melodic lines structure
Single or Multiple melodic lines structure
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
 
Google Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxGoogle Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptx
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
 
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17
 
Interdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxInterdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptx
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdf
 
Spellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseSpellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please Practise
 
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptxSKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
 

Pal gov.tutorial3.session3.xpath & xquery (lab1)

  • 1. ‫أكاديمية الحكومة اإللكترونية الفلسطينية‬ The Palestinian eGovernment Academy www.egovacademy.ps Tutorial III: Process Integration and Service Oriented Architectures Session 3 Xpath & Xquery Prepared By Ismail Romi Palestine Polytechnic University (PPU) Email: ismailr@ppu.edu Reviewed by Prof. Marco Ronchetti and Prof. Paolo 2011 PalGov © Bouquet, Trento University, Italy 1
  • 2. About This tutorial is part of the PalGov project, funded by the TEMPUS IV program of the Commission of the European Communities, grant agreement 511159-TEMPUS-1- 2010-1-PS-TEMPUS-JPHES. The project website: www.egovacademy.ps Project Consortium: Birzeit University, Palestine University of Trento, Italy (Coordinator ) Palestine Polytechnic University, Palestine Vrije Universiteit Brussel, Belgium Palestine Technical University, Palestine Université de Savoie, France Ministry of Telecom and IT, Palestine University of Namur, Belgium Ministry of Interior, Palestine TrueTrust, UK Ministry of Local Government, Palestine Coordinator: Dr. Mustafa Jarrar Birzeit University, P.O.Box 14- Birzeit, Palestine Telfax:+972 2 2982935 mjarrar@birzeit.eduPalGov © 2011 2
  • 3. © Copyright Notes Everyone is encouraged to use this material, or part of it, but should properly cite the project (logo and website), and the author of that part. No part of this tutorial may be reproduced or modified in any form or by any means, without prior written permission from the project, who have the full copyrights on the material. Attribution-NonCommercial-ShareAlike CC-BY-NC-SA This license lets others remix, tweak, and build upon your work non- commercially, as long as they credit you and license their new creations under the identical terms. PalGov © 2011 3
  • 4. Tutorial Map Intended Learning Objectives A: Knowledge and Understanding Title T Name 3a1: Demonstrate knowledge of the fundamentals of middleware. 3a2: Describe the concept behind web service protocols. Session0: Syllabus and overview 0 Aldasht 3a3: Explain the concept of service oriented architecture. Sesson1: Introduction to SOA 2 Aldasht 3a4: Explain the concept of enterprise service bus. Session2: XML namespaces & XML schema 2 Aldasht 3a5: Understanding WSDL service interfaces in UDDI. Session 3: Xpath & Xquery 4 Romi B: Intellectual Skills Session4: REST web services 3 M. Melhem 3b1: Design, develop, and deploy applications based on Service Session5: Lab2: Practice on REST 3 M. Melhem Oriented Architecture (SOA). Session 6: SOAP 2 Aldasht 3b2: use Business Process Execution Language (BPEL). Session 7: WSDL 3 Aldasht 3b3: using WSDL to describe web services. Session8: Lab 3: WSDL practice 3 Aldasht C: Professional and Practical Skills Session9: ESB 4 Aldasht 3c1: setup, Invoke, and deploy web services using integrated Session10: Lab4: Practice on ESB 4 Aldasht development environment. Session11: integration patterns 4 M. Melhem 3c2: construct and use REST and SOAP messages for web services communication. Session12: Lab5: integration patterns 4 M. Melhem D: General and Transferable Skills Session13: BPEL 3 Aldasht d1: Working with team. Session14: Lab6: Practice on BPEL 3 Aldasht d2: Presenting and defending ideas. Session15: UDDI 2 Aldasht d3: Use of creativity and innovation in problem solving. d4: Develop communication skills and logical reasoning abilities. PalGov © 2011 4
  • 5. XPath: Content • Ways of looking at an XML document. • How to visualize XPath and how the component parts of XPath syntax fit together to enable you to navigate around the XPath data model. • The XPath axes—the “directions” that are available to navigate around the XPath data model • XPath 1.0 functions PalGov © 2011 5
  • 6. Ways of Looking at an XML Document • The W3C has developed three specifications: – XPath – XML Document Object Model (DOM) – XML Information Set • each of which represents a logical model of an XML document in similar but distinct ways. PalGov © 2011 6
  • 7. Modeling XML Documents 1. The XPath data model: – Represents most parts of a serialized XML document as a tree of nodes. 2. The Document Object Model: – Represents an XML document as a hierarchical tree of nodes. 3. The XMLInformation Set: – Represents an XMLdocument as a hierarchical tree but uses a different approach from both the XPath model and the DOM. – The XMLInformation Set recommendation is located at http://www.w3.org/TR/xml-infoset/. PalGov © 2011 7
  • 8. Visualizing XPath  XPath can be considered as a street directions around the hierarchical tree of nodes that make up the XPath data model (Axes).  XPath expressions starts from a standard point, (the root node).  In XPath, the starting point is called the context.  All legal XPath code can be called an expression.  An XPath expression that returns a node-set is called a location path. PalGov © 2011 8
  • 9. Visualizing Xpath …Cont • There are 13 directions that can be used. • In XPath, a direction is called an axis. • Example: – /Book/Chapter[@number=2] PalGov © 2011 9
  • 10. Understanding Context • The context indicates the location of the node where a processor is currently situated. • That node is called the context node. PalGov © 2011 10
  • 11. What Is a Node? • A node is a representation in the XPath data model of a logical part of an XML document. • Types:  Root node  Element node  Attribut node  Text node  Namespace node  Comment node  Processing Instruction node PalGov © 2011 11
  • 12. Root Node • The root node represents the document itself, independent of any content. • The root node is the apex of the hierarchy of nodes that represents an XML document. • It has no name and cannot be seen when the document is serialized. • The root node just serves as a starting point when navigating the document. • The root element, is the first element in the document and is a child of the root node. PalGov © 2011 12
  • 13. Element Node • Each element in an XML document is represented as an element node in the XPath data model. • Element nodes have a name that consists of the namespace URI of the element and the local part of its name. The following is an XML document: <?xml version="1.0" encoding="ISO-8859- 1"?> <bookstore> <book> Root Element Node <title lang="en"> Learning XML </title> <author> Ray </author> <year>2003</year> </book> </bookstore> Element Node PalGov © 2011 13
  • 14. Attribute Node • Each attribute in an XML document is represented in the XPath model as an attribute node. • The element node with which the attribute node is associated is said to be the parent node of the attribute node. • Attribute nodes have a name and a value. Example: <?xml version="1.0" encoding="ISO-8859- 1"?> <bookstore> <book> <title lang="en"> Learning XML </title> <author> Ray </author> <year>2003</year> </book> Attribute Node </bookstore> PalGov © 2011 14
  • 15. Text Node • Text content of an element node is represented in the XPath data model as a text node. • The string value of a text node is its character data. • A text node does not have a name. Example: <?xml version="1.0" encoding="ISO-8859- 1"?> Text Node <bookstore> <book> <title lang="en"> Learning XML </title> <author> Ray </author> <year>2003</year> </book> </bookstore> PalGov © 2011 15
  • 16. Namespace Node • Although a specific node can only belong to one namespace. • Any number of in-scope namespaces can be in effect for the node. • In-scope namespaces are those for which there exists a valid prefix to URI mapping or where a URI is associated with an empty prefix, the default namespace. The following is an XML document: <?xml version="1.0" encoding="ISO-8859- 1"?> Namespace Node <bookstore> <book> <title lang="en"> Learning XML </title> <ppu:author> Ray </author> <year>2003</year> </book> </bookstore> PalGov © 2011 16
  • 17. Comment Node • A comment node represents a comment in the XML document. • Comments in the document type declaration are not represented in the XPath data model. Example: <?xml version="1.0" encoding="ISO-8859- 1"?> Comment Node <bookstore> <!-- This is An Example --> <book> <title lang="en"> Learning XML </title> <author> Ray </author> <year>2003</year> </book> </bookstore> PalGov © 2011 17
  • 18. Processing Instruction Node (PI) • A processing instruction node in the XPath model represents a processing instruction in the corresponding XML document. • The name of a processing instruction node is its target. • The string value of a processing instruction node is its content, excluding the target. • Example Of PI’s: •For MS Word 2003 the PI situated right after the XML declaration looks like this: <?mso-application progid="Word.Document"?> •For MS Excel 2003 the PI looks like this: <?mso-application progid="Excel.Sheet"?> PalGov © 2011 18
  • 19. Location Paths • An expression that specifies how to navigate an XPath tree from one node to another. • A location path is composed of location steps, each of which is composed of: – An “axis,” – A “node test” – An optional “predicate.” • To locate a specific node in an XML document, we put together multiple location steps, each of which refines the search. PalGov © 2011 19
  • 20. XPath 1.0 Axes Axis Name Ordering Description self none The context node itself. parent reverse The context node’s parent, if one exists. child forward The context node’s children, if they exist. ancestor reverse The context node’s ancestors, if they exist. ancestor-or-self reverse The context node’s ancestors and also itself. descendant forward The context node’s descendants. descendant-or-self forward The context node’s descendants and also itself. following forward The nodes in the XML document following the context node, not including descendants. following-sibling forward The sibling nodes following the context node. preceding reverse The nodes in the XML document preceding the context node, not including ancestors. preceding-sibling reverse The sibling nodes preceding the context node. attribute forward The attribute nodes of the context node. namespace forward The namespace nodes of the context node. PalGov © 2011 20
  • 21. Parent Axis • Each element and attribute has one parent. • Example <book> <title>Harry Potter</title> <author>J K. Rowling</author> <year>2005</year> <price>29.99</price> </book> – book element is the parent of the title, author, year, and price: PalGov © 2011 21
  • 22. Child Axis • Element nodes may have zero, one or more children. • Example <book> <title>Harry Potter</title> <author>J K. Rowling</author> <year>2005</year> <price>29.99</price> </book> – title, author, year, and price elements are all children of the book element: PalGov © 2011 22
  • 23. Siblings • Nodes that have the same parent. • Example: <book> <title>Harry Potter</title> <author>J K. Rowling</author> <year>2005</year> <price>29.99</price> </book> – title, author, year, and price elements are all siblings. PalGov © 2011 23
  • 24. Ancestors • Node's parent, parent's parent, etc. • Example: <bookstore> <book> <title>Harry Potter</title> <author>J K. Rowling</author> <year>2005</year> <price>29.99</price> </book> </bookstore> – The ancestors of the title element are the book element and the bookstore element. PalGov © 2011 24
  • 25. Descendants • A node's children, children's children, etc. • Example: <bookstore> <book> <title>Harry Potter</title> <author>J K. Rowling</author> <year>2005</year> <price>29.99</price> </book> </bookstore> – Descendants of the bookstore element are the book, title, author, year, and price elements. PalGov © 2011 25
  • 26. Location Path Expression • An XPath expression returns either a node-set, a string, a Boolean, or a number. • A location path can be absolute or relative. – An absolute location path starts with a slash ( / ) – A relative location path does not. • In both cases the location path consists of one or more steps. • Examples: • An absolute location path: /step/step/... • A relative location path: step/step/... PalGov © 2011 26
  • 27. Location Path Expression…Cont • The syntax for a location step is: axisname::nodetest[predicate] PalGov © 2011 27
  • 28. Location Path Expression…Cont • Example: <?xml version="1.0" encoding="ISO-8859-1"?> ………… ………… <bookstore> <book> <title lang="en">Harry Potter</title> <author>J K. Rowling</author> <year>2005</year> <price>29.99</price> </book> </bookstore> PalGov © 2011 28
  • 29. Location Path Expression…Cont axisname::nodetest[predicate] Example Result child::book Selects all book nodes that are children of the current node attribute::lang Selects the lang attribute of the current node child::* Selects all children of the current node attribute::* Selects all attributes of the current node child::text() Selects all text child nodes of the current node child::node() Selects all child nodes of the current node descendant::book Selects all book descendants of the current node ancestor::book Selects all book ancestors of the current node ancestor-or- Selects all book ancestors of the current node self::book - and the current as well if it is a book node child::*/child::price Selects all price grandchildren of the current node PalGov © 2011 29
  • 30. Location Path Expression…Cont Node Test Description * Selects all nodes of the same principal node type. node() Selects all nodes, regardless of their type. text() Selects all text nodes. comment() Selects all comment nodes. processing- Selects all processing- instruction() instruction nodes. node name Selects all nodes with the specified node name. Steps Operators: slash (/)Separates location steps. double-slash (//)Abbreviation for the location path PalGov © 2011 30
  • 31. Xpath Operators Operator Description Example Return value | Performs the union of two node- //book | //cd Returns a node-set with all sets book and cd elements + Addition 6+4 10 - Subtraction 6-4 2 * Multiplication 6*4 24 div Division 8 div 4 2 = Equal price=9.80 true if price is 9.80 != Not equal price!=9.80 false if price is 9.80 < Less than price<9.80 true if price is 9.00 <= Less than or equal to price<=9.80 true if price is 9.00 > Greater than price>9.80 true if price is 9.90 >= Greater than or equal to price>=9.80 true if price is 9.90 or or price=9.80 or price=9.70 true if price is 9.80 and and price>9.00 and price<9.90 true if price is 9.80 mod Modulus (division remainder) 5 mod 2 1 PalGov © 2011 31
  • 32. node-set functions…Examples Node-set Functions Description last() Returns the last node in the node-set. position() Returns the position number of the current node in the node-set being tested. count( node-set ) Returns the number of nodes in node-set. id( string ) Returns the element node whose ID attribute matches the value specified by argument string. local-name( node-set ) Returns the local part of the expanded-name for the first node in node-set. namespace-uri( node-set ) Returns the namespace URI of the expanded- name for the first node in node-set. name( node-set ) Returns the qualified name for the first node in node-set. PalGov © 2011 32
  • 33. Examples • head/title[ last() ] – select the last title element node contained in the head element node • book[ position() = 3 ] – select the third book element of the context node. The location path – …… – ….. PalGov © 2011 33
  • 34. Databases: Xquery (the XML Query Language) • Why XQuery was created. • How to get started with Xquery. • How to query an XMLdocument using Xquery. • XQuery data model. • XQuery functions. PalGov © 2011 34
  • 35. XQuery • XQuery is to XML what SQL is to database tables. • XQuery is designed to query XML data - not just XML files, but anything that can appear as XML, including databases. • Xquery is designed around a data model that has the property to be serialized as XML. • XML data requires many of the features already available in DBMS (indexing, security….). • XQuery is compatible with several W3C standards, such as XML, Namespaces, XSLT, XPath, and XML Schema. • XQuery 1.0 became a W3C Recommendation January 23, 2007. PalGov © 2011 35
  • 36. XQuery Tools • XQuery is still relatively new. • A large number of software companies and independent developers have developed partial or more complete implementations of XQuery. • W3C updates a web page where links to XQuery implementations and other sources of useful XQuery information are included (www.w3.org/XML/Query). PalGov © 2011 36
  • 37. XQuery Tools…Cont Example: • Saxon Xquery engine. • X-Hive Database • Tamino Database • Microsoft SQL Server 2005 • Oracle • Stylus Stodio PalGov © 2011 37
  • 38. XQuery - Examples of Use • XQuery can be used to: – Extract information to use in a Web Service – Generate summary reports – Transform XML data to XHTML – Search Web documents for relevant information PalGov © 2011 38
  • 39. Extracting Data From XML Document • Open the xml document: – The doc() function is used to open the xml document. • Path Expressions: – XQuery uses path expressions to navigate through elements in an XML document. • Predicates: – XQuery uses predicates to limit the extracted data from XML documents. • Functions: – XQuery uses functions to extract data from XML documents. PalGov © 2011 39
  • 40. doc() Function • Used to open the XML document. • Exampl books.xml • Retrieving the previous document: – doc(books.xml) • Retrieving part of the document: – You have to use the Xpath expressions. – doc("books.xml")/bookstore/book/title PalGov © 2011 40
  • 41. Predicates • XQuery uses predicates to limit the extracted data from XML documents. • Example: – doc("books.xml")/bookstore/book[price<30] PalGov © 2011 41
  • 42. XQuery Basic Syntax Rules • XQuery is case-sensitive • XQuery elements, attributes, and variables must be valid XML names • An XQuery string value can be in single or double quotes • An XQuery variable is defined with a $ followed by a name, e.g. $bookstore • XQuery comments are delimited by (: and :) • Example: (: XQuery Comment :) PalGov © 2011 42
  • 43. XQuery FLWOR Expressions (for, let, where, order by, return) • for clause selects all elements. • where clause selects only elements with a specified predicate. • order by clause defines the sort-order. • return clause specifies what should be returned. • let clause allows variable assignments. PalGov © 2011 43
  • 44. for , return expressions • Used for looping • Example: for $x in doc("books.xml")/bookstore/book return $x/title • This for: – loops all bookstore/book – returns the title element • $x: variable name PalGov © 2011 44
  • 45. Filtering with where clause • where used in for expression to filter the returned values. • Example: for $x in doc("books.xml")/bookstore/book where $x/price>30 return $x/title PalGov © 2011 45
  • 46. Sorting using order by clause • Used to sort the output in a specified order. • Example: for $x in doc("books.xml")/bookstore/book where $x/price>30 order by $x/title return $x/title PalGov © 2011 46
  • 47. The let Clause • The let clause: – allows variable assignments – avoids repeating the same expression many times. – does not result in iteration. • Example: let $x := "Ahmad" return <name>{$x}</name> Output: <name> Ahmad </name> PalGov © 2011 47
  • 48. If-Then-Else • An XQuery Conditional Expressions. • Example: for $x in doc("books.xml")/bookstore/book return if ($x/@category="CHILDREN") then <child>{data($x/title)}</child> else <adult>{data($x/title)}</adult> • Notes: – $x: refers to variable name x – @ refers to an attribute – parentheses around the if expression are required. – else is required, but it can be just else (). PalGov © 2011 48
  • 49. XQuery Adding Elements and Attributes • You can add elements and attributes to the output document. Example: for $x in doc("books.xml")/bookstore/book/title return $x, <name> ali </name> • This example adds name element to the output stream. PalGov © 2011 49
  • 50. Xquery Functions • XQuery includes over 100 built-in functions. • There are functions for string values, numeric values, date and time comparison, node and QName manipulation, sequence manipulation, Boolean values, and more. • Functions found in the w3c web site: www.w3.org/tr/xpath-functions PalGov © 2011 50
  • 51. Examples of built-in Function <name>{uppercase($booktitle)}</name> for $x in doc("books.xml")/bookstore/book order by $x/title return $x/data(title) Note: you have to practice w3c Xquery functions. PalGov © 2011 51
  • 52. Xquery and HTML • You can generate an HTML document using Xquery. • You can add elements • You can add attribute. PalGov © 2011 52
  • 53. Example1: Xquery expression: <ul> { for $x in doc("books.xml")/bookstore/book/title order by $x return <li>{$x}</li> } </ul> Output: <ul> <li><title lang="en">Everyday Italian</title></li> <li><title lang="en">Harry Potter</title></li> <li><title lang="en">Learning XML</title></li> <li><title lang="en">XQuery Kick Start</title></li> </ul> PalGov © 2011 53
  • 54. Example2 • Xquery expression: <ul> { for $x in doc("books.xml")/bookstore/book/title order by $x return <li>{data($x)}</li> } </ul> • Out put / HTML <ul> <li>Everyday Italian</li> <li>Harry Potter</li> <li>Learning XML</li> <li>XQuery Kick Start</li> </ul> PalGov © 2011 54
  • 55. Example 3 • Xquery: <html> <body> <h1>Bookstore</h1> <ul> { for $x in doc("books.xml")/bookstore/book order by $x/title return <li>{data($x/title)}. Category: {data($x/@category)}</li> } </ul> </body> </html> PalGov © 2011 55
  • 56. Example 3….Cont • Out put: <html> <body> <h1>Bookstore</h1> <ul> <li>Everyday Italian. Category: COOKING</li> <li>Harry Potter. Category: CHILDREN</li> <li>Learning XML. Category: WEB</li> <li>XQuery Kick Start. Category: WEB</li> </ul> </body> </html> PalGov © 2011 56
  • 57. References 1. Hunter, H, Rafter, J., Fawcett, J., Vlist, E., Ayers, D., Duckett, J., Watt, A., McKinnon,L., (2007), "Beginning XML", 4th Ed.,Wiley Publishing Inc: Indiana, USA. 2. Ray, E., (2003), "Learning XML", 2nd Ed., O’Rreilly Media Inc.: USA. 3. http://www.w3.org 4. http://www.w3schools.com 5. http://www.xml.com 6. http://www.xml.org PalGov © 2011 57
  • 58. Thanks Ismail Romi PalGov © 2011 58