XML Trends & Developments

XML Foundations (INFOSYS 242)

Erik Wilde, UC Berkeley iSchool
Tuesday, October 24, 2006
Creative Commons License

This work is licensed under a Creative Commons
Attribution-NonCommercial-ShareAlike 2.5 License.

Abstract

XML is a very basic technology for representing trees using a standardized markup-based syntax. An increasing number of technologies are building on this foundation, creating an expanding field of XML-based technologies for interoperability in many different fields. Application-specific XML-based data formats are used in many different settings, and the best data format for a given scenario depends on the existing formats in this area and the exact requirements. More interestingly, generic XML technologies which can be applied in many different settings make it easier for developers and system integrators to achieve their goal of making system interoperate.

Course Evaluation

Outline (Web Services)

  1. Web Services [5]
  2. XForms [3]
  3. XPath 2.0 [5]
    1. XSLT 2.0 [2]
    2. XQuery [2]
  4. Semantic Web [2]
  5. Conclusions [2]

XML-Based Distributed Programming

Web Service Technologies

SOAP Example Message

<?xml version="1.0"?>
<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope">
 <env:Header>
  <m:reservation xmlns:m="http://travelcompany.example.org/reservation" env:role="http://www.w3.org/2003/05/soap-envelope/role/next" env:mustUnderstand="true">
   <m:reference>uuid:093a2da1-q345-739r-ba5d-pqff98fe8j7d</m:reference>
   <m:dateAndTime>2001-11-29T13:20:00.000-05:00</m:dateAndTime>
  </m:reservation>
  <n:passenger xmlns:n="http://mycompany.example.com/employees" env:role="http://www.w3.org/2003/05/soap-envelope/role/next" env:mustUnderstand="true">
   <n:name>Åke Jógvan Øyvind</n:name>
  </n:passenger>
 </env:Header>
 <env:Body>
  <p:itinerary xmlns:p="http://travelcompany.example.org/reservation/travel">
   <p:departure>
    <p:departing>New York</p:departing>
    <p:arriving>Los Angeles</p:arriving>
    <p:departureDate>2001-12-14</p:departureDate>
    <p:departureTime>late afternoon</p:departureTime>
    <p:seatPreference>aisle</p:seatPreference>
   </p:departure>
   <p:return>
    <p:departing>Los Angeles</p:departing>
    <p:arriving>New York</p:arriving>
    <p:departureDate>2001-12-20</p:departureDate>
    <p:departureTime>mid-morning</p:departureTime>
    <p:seatPreference/>
   </p:return>
  </p:itinerary>
  <q:lodging xmlns:q="http://travelcompany.example.org/reservation/hotels">
   <q:preference>none</q:preference>
  </q:lodging>
 </env:Body>
</env:Envelope>

WSDL Example (Google)

 <portType name="GoogleSearchPort">
  <operation name="doGetCachedPage">
   <input message="typens:doGetCachedPage"/>
   <output message="typens:doGetCachedPageResponse"/>
  </operation>
  <operation name="doSpellingSuggestion">
   <input message="typens:doSpellingSuggestion"/>
   <output message="typens:doSpellingSuggestionResponse"/>
  </operation>
  <operation name="doGoogleSearch">
   <input message="typens:doGoogleSearch"/>
   <output message="typens:doGoogleSearchResponse"/>
  </operation>
 </portType>

UDDI Data Model

Outline (XForms)

  1. Web Services [5]
  2. XForms [3]
  3. XPath 2.0 [5]
    1. XSLT 2.0 [2]
    2. XQuery [2]
  4. Semantic Web [2]
  5. Conclusions [2]

HTML Forms Limitations

XForms

XForms Limitations

Outline (XPath 2.0)

  1. Web Services [5]
  2. XForms [3]
  3. XPath 2.0 [5]
    1. XSLT 2.0 [2]
    2. XQuery [2]
  4. Semantic Web [2]
  5. Conclusions [2]

XML Databases

Outline (XSLT 2.0)

  1. Web Services [5]
  2. XForms [3]
  3. XPath 2.0 [5]
    1. XSLT 2.0 [2]
    2. XQuery [2]
  4. Semantic Web [2]
  5. Conclusions [2]

XSLT Improvements

<!-- tokenize the input file by lines and output them as newline-separated list of strings. -->
<xsl:variable name="listing" select="string-join(tokenize(unparsed-text($fileuri, 'UTF-8'), '\r?\n'), '&#xa;')"/>
<xsl:value-of select="if (@tab eq 'retain') then $listing else replace($listing, '\t', ' ')"/>

XPath vs. XSLT

<xsl:value-of select="if ( @gender = 'male' ) then 'Sir' else 'Madam'"/>
<xsl:choose>
  <xsl:when test="@lang = 'en'">English</xsl:when>
  <xsl:when test="@lang = 'de'">Deutsch</xsl:when>
  <xsl:when test="@lang = 'fr'">Français</xsl:when>
  <xsl:otherwise>n/a</xsl:otherwise>
</xsl:choose>

Outline (XQuery)

  1. Web Services [5]
  2. XForms [3]
  3. XPath 2.0 [5]
    1. XSLT 2.0 [2]
    2. XQuery [2]
  4. Semantic Web [2]
  5. Conclusions [2]

XML Query Language (XQuery)

XQuery Example

  <video id="3325584384">
   <studio></studio>
   <actorRef>325442748</actorRef>
   <actorRef>2096814035</actorRef>
   <actorRef>4231919377</actorRef>
   <director>Louis Malle</director>
   <title>Au Revoir Les Enfants</title>
  <actor id="325442748">Feito, Raphael</actor>
  <actor id="4231919377">Morier, Philippe</actor>
  <actor id="2142583927">Racette, Francine</actor>
declare variable $firstName external;
<videos featuring="{$firstName}">
{
   let $doc := .
   for $v in $doc//video,
      $a in $doc//actors/actor
   where ends-with($a, $firstName) and $v/actorRef = $a/@id
   order by $v/year
   return
      <video year="{$v/year}">
         {$v/title}
      </video>
}
</videos> 

Outline (Semantic Web)

  1. Web Services [5]
  2. XForms [3]
  3. XPath 2.0 [5]
    1. XSLT 2.0 [2]
    2. XQuery [2]
  4. Semantic Web [2]
  5. Conclusions [2]

XML is Syntax

<?xml version="1.0" encoding="UTF-8"?>
<文書 改訂日付="1999年3月1日">
 <題>サンプル</題>
 <段落>これはサンプル文書です。</段落>
 <!-- コメント -->
 <段落>会社名</段落>
 <図面 図面実体名="サンプル" />
</文書>

Semantics

Outline (Conclusions)

  1. Web Services [5]
  2. XForms [3]
  3. XPath 2.0 [5]
    1. XSLT 2.0 [2]
    2. XQuery [2]
  4. Semantic Web [2]
  5. Conclusions [2]

XML is Growing

Discussion