\documentclass[twoside,a4paper,10pt]{report}
\usepackage[french]{babel} %% Use your own babel language
\usepackage[top=3cm,bottom=3cm,left=2.5cm,right=2.5cm]{geometry}
\usepackage[utf8]{inputenc}
\usepackage{pslatex}
\usepackage{hyperref}
\usepackage{graphicx}
\usepackage{tabularx}
\usepackage{supertabular}
\usepackage{pdflscape} %% Used for very big table
\usepackage{moreverb}
\usepackage{color}
\usepackage{listings}
\usepackage{lastpage}
\usepackage{fancyhdr}
\usepackage{ulem}
\usepackage{textcomp}
\usepackage{wasysym}
\usepackage{wrapfig} %%Usefull for image 
%%\usepackage{fguill} %%Use this package for guillemot[left|right] useless with babel set to french
\usepackage{eso-pic} %% Background
\pagestyle{fancy}%
\renewcommand{\headrulewidth}{0.1pt}
\renewcommand{\footrulewidth}{0pt}
\renewcommand{\chaptermark}[1]{%
	\markboth{\chaptername\ \thechapter.\ #1}{}}

\renewcommand{\sectionmark}[1]{%
	\markright{#1}{}}

\fancypagestyle{plain}{%
\fancyhf{}
\fancyfoot[R]{\thepage/\pageref{LastPage}}
\renewcommand{\headrulewidth}{0pt}
\renewcommand{\footrulewidth}{0pt}}
\fancyhf{}
\fancyhead[L]{\rightmark}
\fancyhead[R]{\leftmark}
\fancyfoot[R]{\thepage/\pageref{LastPage}}
\renewcommand{\headrulewidth}{0.1pt}
\renewcommand{\footrulewidth}{0pt}

\definecolor{codegray}{gray}{.95}
\lstset{language=C,
	numbers=left,
	tabsize=2,
	basicstyle=\scriptsize,
	stringstyle=\textrm,
	showstringspaces=false,
	frame=none,
	xleftmargin=3pt,
	backgroundcolor=\color{codegray}}

\newcommand{\settexitref}[2]{(\ref{#1}p\pageref{#1})}
\newcommand{\dokutitlelevelone}[1]{\chapter{#1}}
\newcommand{\dokutitleleveltwo}[1]{\section{#1}}
\newcommand{\dokutitleleveltree}[1]{\subsection{#1}}
\newcommand{\dokutitlelevelfour}[1]{\subsubsection{#1}}
\newcommand{\dokutitlelevelfive}[1]{\paragraph{#1}}
\newcommand{\dokufootnote}[1]{\footnote{#1}}
\newcommand{\dokufootmark}[1]{\footnotemark[#1]}
\newcommand{\dokubold}[1]{\textbf{#1}}
\newcommand{\dokuitalic}[1]{\textsl{#1}}
\newcommand{\dokumonospace}[1]{\texttt{#1}}
\newcommand{\dokuunderline}[1]{\underline{#1}}
\newcommand{\dokuoverline}[1]{\sout{#1}}
\newcommand{\dokusupscript}[1]{\textsuperscript{#1}}
\newcommand{\dokusubscript}[1]{$_{#1}$}
\newcommand{\dokuhline}{\line(1,0){400}}
\newcommand{\dokulabel}[1]{\label{#1}}
\newcommand{\dokuitem}{\item}
\newcommand{\dokuquoting}{\textbar}
\newcommand{\dokutabularwidth}{\textwidth}
\newcommand{\dokusupertabularheadbreak}{\small\sl continued from previous page}
\newcommand{\dokusupertabulartailbreak}{\small\sl continued on next page}
\newcommand{\dokuheadingstyle}[1]{\textbf{#1}}
\definecolor{dokuheadingcolor}{rgb}{0,0,0.60}
\newcommand{\dokubackground}[1]{%
\AddToShipoutPicture{%
  \AtTextCenter{%
    \makebox(0,0)[c]{\resizebox{\textwidth}{!}{%
      \rotatebox{25}{\textsf{\textbf{\textcolor[gray]{0.90}{#1}}}}}}%
  }%
 }%
}

\hypersetup{
pdftitle = {CC XSLT},
pdfauthor = {E. Bruno},
pdfcreator = {DokuTeXit},
pdfproducer = {dokuwiki + TeXit + pdflatex}
}
\title{CC XSLT}
\author{E. Bruno}
\dokubackground{http://lsis.univ-tln.fr/\~{ }bruno/}
\begin{document}
\thispagestyle{empty}
\maketitle
\thispagestyle{empty}
\cleardoublepage
\tableofcontents
\newpage
\thispagestyle{plain}
\cleardoublepage
\newpage



\dokutitlelevelone{Contrôle Continu Structure de Données Web}
\label{e884d37e15bc69f65a1f289e8053fd01}%% controle_continu_structure_de_donnees_web
\label{f8cae98e859bf49e2dffab03df143156}%%Start: ccxslt => /home/bruno/public_html/data/pages/ccxslt.txt
\dokubold{Vous avez droits à tous les documents.}

Vous devrez rendre trois feuilles de style \dokubold{exo1{\textunderscore}1.xsl}, \dokubold{exo1{\textunderscore}2.xsl} et \dokubold{exo2.xsl}. Ces documents seront déposés sur esparon et par sécurité envoyées aussi à l'adresse bruno@univ-tln.fr.
Les noms des fichiers \dokumonospace{report.xml} et \dokumonospace{bid.xml} sont cliquables pour pouvoir être téléchargés.


\dokutitleleveltwo{Exercice 1}
\label{a549801f58eb0724a095b4a58587d4fb}%% exercice_1
Le document xml \dokumonospace{report.xml} décrit des opérations chirurgicales.


\begin{itemize}
\dokuitem  Ecrire la feuille de style \dokubold{exo1{\textunderscore}1.xsl} qui retourne uniquement le texte du document ci-dessous.
\dokuitem  Ecrire la feuille de style \dokubold{exo1{\textunderscore}2.xsl} qui 
\begin{itemize}
\dokuitem  Construit un document XHTML\dokufootnote{Extensible HyperText Markup Language} ayant un élément \dokumonospace{title} dans le \dokumonospace{head} et un \dokumonospace{h1} dans le \dokumonospace{body}. Le contenu de ces deux éléments sera le contenu l'élément \dokumonospace{title} du \dokumonospace{report} (ici \dokuitalic{HL7 Patient Records}).
\dokuitem  Ajouter le texte "Nombre d'incisions :" suivi nombre d'éléments incision (calculé) dans le documents.
\dokuitem  Ajouter le texte "Observation après la première incision : " suivi du texte de cette observation (extrait automatiquement).
\dokuitem  Pour chaque \dokumonospace{section} créer un élément \dokumonospace{div} ayant un attribut \dokumonospace{class="section"}. Dans le \dokumonospace{div}, ajouter un élément \dokumonospace{h1} dont le contenu est le \dokumonospace{title} de la section.
\dokuitem  Ajouter dans le \dokumonospace{div}, la liste HTML\dokufootnote{HyperText Markup Language} de toutes les \dokumonospace{actions}, contenues dans le \dokumonospace{content} de la \dokumonospace{section}. Il ne doit rien y avoir d'autre dans le \dokumonospace{div}.
\dokuitem  En utilisant le foreach. Ajouter un élément \dokumonospace{div} dans le \dokumonospace{body} qui contient la liste de tous les \dokumonospace{instrument} utilisés dans l'ordre d'apparition dans le document.
\dokuitem  En utilisant le foreach. Ajouter un élément \dokumonospace{div} dans le \dokumonospace{body} qui contient la liste de tous les \dokumonospace{instrument} par ordre alphabétique inverse et sans doublons. Ajouter un attribut \dokumonospace{nb} à l'élément \dokumonospace{UL} qui indique le nombre total d'instruments uniques.
\dokuitem  Déclarer une variable "globale" appelée \dokumonospace{instrument} et dont la valeur est "hasson trocar". Ajouter un élément \dokumonospace{div} qui contient le texte de la dernière action qui contient l'instrument indiqué dans la variable \dokumonospace{{\textdollar}instrument}.
\end{itemize}

\end{itemize}

\small
\begin{verbatimtab}

<report>
  <title>HL7 Patient Records</title>
  <section>
    <title>Procedure</title>
     <content>
      The patient was taken to the operating room where she was placed
      in supine position and
      <anesthesia>induced under general anesthesia.</anesthesia>
      <prep> 
        <action>A Foley catheter was placed to decompress the bladder</action>
        and the abdomen was then prepped and draped in sterile fashion.
      </prep>  
      <incision>
        A curvilinear incision was made
        <geography>in the midline immediately infraumbilical</geography>
        and the subcutaneous tissue was divided
        <instrument>using electrocautery.</instrument>
      </incision>
      The fascia was identified and
      <action>#2 0 Maxon stay sutures were placed on each side of the midline.
      </action>
      <incision>
        The fascia was divided using
        <instrument>electrocautery</instrument>
        and the peritoneum was entered.
      </incision>
      <observation>The small bowel was identified.</observation>
      and
      <action>
        the
        <instrument>Hasson trocar</instrument>
        was placed under direct visualization.
      </action>
      <action>
        The
        <instrument>trocar</instrument>
        was secured to the fascia using the stay sutures.
      </action>
     </content>
  </section>
</report>

\end{verbatimtab}
\normalsize

\dokutitleleveltwo{Exercice 2}
\label{9a9344fbda8cf94789e0564a425a5c9e}%% exercice_2
Le document XML\dokufootnote{Extensible Markup Language} \dokumonospace{bid.xml} représente :


\begin{itemize}
\dokuitem  des utilisateurs (\dokumonospace{user{\textunderscore}tuple}), 
\end{itemize}
Par exemple, ici l'utilisateur dont l'identifiant est U01 :


\lstset{language=xml}
\begin{lstlisting}
  <user_tuple>
      <userid>U01</userid>
      <name>Tom Jones</name>
      <rating>B</rating>
  </user_tuple>

\end{lstlisting}

\begin{itemize}
\dokuitem  des objects mis aux enchères (\dokumonospace{item{\textunderscore}tuple})
\end{itemize}
Par exemple, l'objet dont l'identifiant est 1001 mis en vente par l'utilisateur (\dokumonospace{offered{\textunderscore}by}) U01.


\lstset{language=xml}
\begin{lstlisting}
  <item_tuple>
      <itemno>1001</itemno>
      <description>Red Bicycle</description>
      <offered_by>U01</offered_by>
      <start_date>1999-01-05</start_date>
      <end_date>1999-01-20</end_date>
      <reserve_price>40</reserve_price>
    </item_tuple>

\end{lstlisting}

\begin{itemize}
\dokuitem  des enchères (\dokumonospace{bid{\textunderscore}tuple})
\end{itemize}
Par exemple, l'offre de l'utilisateur U01 pour l'objet 1002 est de 400F.


\lstset{language=xml}
\begin{lstlisting}
    <bid_tuple>  
      <userid>U01</userid> 
      <itemno>1002</itemno> 
      <bid>400</bid> 
      <bid_date>1999-02-14</bid_date> 
    </bid_tuple>

\end{lstlisting}
Proposer une feuille de style XSL\dokufootnote{Extensible Stylesheet Language} \dokumonospace{exo2.xsl} qui représente les utilisateurs, les objets et les enchères sous la formes de trois tableaux HTML\dokufootmark{2}. 

Vous devrez faire en sorte que les Information soient lisibles : le nom des propriétaires des objets seront mis en toutes lettre (pas uniquement leur code), de même pour les enchères (bids{\textunderscore}tuple) le noms utilisateurs et objets sera en toute lettre.

BONUS : mettre en gras la meilleure offre pour chaque objet.


\small
\begin{verbatimtab}

<?xml version='1.0'?>
<data>
  <users>
    <user_tuple>
      <userid>U01</userid>
      <name>Tom Jones</name>
      <rating>B</rating>
    </user_tuple>
    <user_tuple>
      <userid>U02</userid>
      <name>Mary Doe</name>
      <rating>A</rating>
    </user_tuple>
    <user_tuple>
      <userid>U03</userid>
      <name>Dee Linquent</name>
      <rating>D</rating>
    </user_tuple>
    <user_tuple>
      <userid>U04</userid>
      <name>Roger Smith</name>
      <rating>C</rating>
    </user_tuple>
    <user_tuple>
      <userid>U05</userid>
      <name>Jack Sprat</name>
      <rating>B</rating>
    </user_tuple>
    <user_tuple>
      <userid>U06</userid>
      <name>Rip Van Winkle</name>
      <rating>B</rating>
    </user_tuple>
  </users>
  <items>
    <item_tuple>
      <itemno>1001</itemno>
      <description>Red Bicycle</description>
      <offered_by>U01</offered_by>
      <start_date>1999-01-05</start_date>
      <end_date>1999-01-20</end_date>
      <reserve_price>40</reserve_price>
    </item_tuple>      
    <item_tuple>
      <itemno>1002</itemno>
      <description>Motorcycle</description>
      <offered_by>U02</offered_by>
      <start_date>1999-02-11</start_date>
      <end_date>1999-03-15</end_date>
      <reserve_price>500</reserve_price>
    </item_tuple>
    <item_tuple>
      <itemno>1003</itemno>
      <description>Old Bicycle</description>
      <offered_by></offered_by>
      <start_date>1999-01-10</start_date>
      <end_date>1999-02-20</end_date>
      <reserve_price>25</reserve_price>
    </item_tuple>
    <item_tuple>
      <itemno>1004</itemno>
      <description>Tricycle</description>
      <offered_by>U01</offered_by>
      <start_date>1999-02-25</start_date>
      <end_date>1999-03-08</end_date>
      <reserve_price>15</reserve_price>
    </item_tuple>
    <item_tuple>
      <itemno>1005</itemno>
      <description>Tennis Racket</description>
      <offered_by>U03</offered_by>
      <start_date>1999-03-19</start_date>
      <end_date>1999-04-30</end_date>
      <reserve_price>20</reserve_price>
    </item_tuple>
    <item_tuple>
      <itemno>1006</itemno>
      <description>Helicopter</description>
      <offered_by>U03</offered_by>
      <start_date>1999-05-05</start_date>
      <end_date>1999-03-06</end_date>
      <reserve_price>50000</reserve_price>
    </item_tuple>
    <item_tuple>
      <itemno>1007</itemno>
      <description>Racing Bicycle</description>
      <offered_by>U04</offered_by>
      <start_date>1999-01-20</start_date>
      <end_date>1999-05-25</end_date>
      <reserve_price>200</reserve_price>
    </item_tuple>
    <item_tuple>
      <itemno>1008</itemno>
      <description>Broken Bicycle</description>
      <offered_by>U01</offered_by>
      <start_date>1999-02-05</start_date>
      <end_date>1999-02-20</end_date>
      <reserve_price>25</reserve_price>
    </item_tuple>
  </items>
  <bids>
    <bid_tuple> 
      <userid>U02</userid> 
      <itemno>1001</itemno> 
      <bid>35</bid> 
      <bid_date>1999-01-07</bid_date> 
    </bid_tuple> 
    <bid_tuple> 
      <userid>U04</userid> 
      <itemno>1001</itemno> 
      <bid>40</bid> 
      <bid_date>1999-01-08 </bid_date> 
    </bid_tuple> 
    <bid_tuple> 	 
      <userid>U02</userid> 
      <itemno>1001</itemno> 
      <bid>45</bid> 
      <bid_date>1999-01-11 </bid_date> 
    </bid_tuple> 
    <bid_tuple>  
      <userid>U04</userid> 
      <itemno>1001</itemno> 
      <bid>50</bid> 
      <bid_date>1999-01-13</bid_date> 
    </bid_tuple> 
    <bid_tuple>  
      <userid>U02</userid> 
      <itemno>1001</itemno> 
      <bid>55</bid> 
      <bid_date>1999-01-15</bid_date> 
    </bid_tuple> 
    <bid_tuple>  
      <userid>U01</userid> 
      <itemno>1002</itemno> 
      <bid>400</bid> 
      <bid_date>1999-02-14</bid_date> 
    </bid_tuple> 
    <bid_tuple> 
      <userid>U02</userid> 
      <itemno>1002</itemno> 
      <bid>600</bid> 
      <bid_date>1999-02-16</bid_date> 
    </bid_tuple> 
    <bid_tuple> 
      <userid>U03</userid> 
      <itemno>1002</itemno> 
      <bid>800</bid> 
      <bid_date>1999-02-17</bid_date> 
    </bid_tuple>
    <bid_tuple>  
      <userid>U04</userid> 
      <itemno>1002</itemno> 
      <bid>1000</bid> 
      <bid_date>1999-02-25</bid_date> 
    </bid_tuple> 
    <bid_tuple>  
      <userid>U02</userid> 
      <itemno>1002</itemno> 
      <bid>1200</bid> 
      <bid_date>1999-03-02</bid_date> 
    </bid_tuple> 
    <bid_tuple>  
      <userid>U04</userid> 
      <itemno>1003</itemno> 
      <bid>15</bid> 
      <bid_date>1999-01-22</bid_date> 
    </bid_tuple> 
    <bid_tuple> 
      <userid>U05</userid> 
      <itemno>1003</itemno> 
      <bid>20</bid> 
      <bid_date>1999-02-03</bid_date> 
    </bid_tuple> 
    <bid_tuple> 
      <userid>U01</userid> 
      <itemno>1004</itemno> 
      <bid>40</bid> 
      <bid_date>1999-03-05</bid_date> 
    </bid_tuple> 
    <bid_tuple>  
      <userid>U03</userid> 
      <itemno>1007</itemno> 
      <bid>175</bid> 
      <bid_date>1999-01-25</bid_date> 
    </bid_tuple> 
    <bid_tuple>  
      <userid>U05</userid> 
      <itemno>1007</itemno> 
      <bid>200</bid> 
      <bid_date>1999-02-08</bid_date> 
    </bid_tuple> 
    <bid_tuple>  
      <userid>U04</userid> 
      <itemno>1007</itemno> 
      <bid>225</bid> 
      <bid_date>1999-02-12</bid_date> 
    </bid_tuple> 
  </bids>
</data>

\end{verbatimtab}
\normalsize
\end{document}

