UP PREVIOUS NEXT   Technologies Internet et Education, © TECFA
  4. Langages auxiliares

4. Langages auxiliares

4.1 Xpointer

xpointer(//EPISODE)
<a href="test.xml#xpointer//name[1]>
<xi:include href="
/db/shakespeare/plays/macbeth.xml#xpointer
      (//SPEECH[SPEAKER&='witch' and near(LINE, 'fenny snake')])"  />

4.2 XInclude

   xmllint --xinclude includes.xml > output.xml 

(le fichier "includes.xml" contient le XInclude)

Exemple 4-1: Exemple assemblage d'un "livre"

(cf. page suivante)
<?xml version="1.0" encoding="ISO-8859-1" ?>
<book xmlns:xi="http://www.w3.org/2001/XInclude">
 <xi:include href="intro-kiah.xml"/>
 <xi:include href="paper6.xml"/> 
 <xi:include href="http://tecfaseed.unige.ch/staf18/modules/ePBL/uploads/proj3/paper81.xml"/>
..... </book>

Exemple 4-2: XInclude de fragments non XML

<?xml version='1.0'?>
<document xmlns:xi="http://www.w3.org/2001/XInclude">
  <p>This document has been accessed
  <xi:include href="count.txt" parse="text"/
> times.</p>
</document>
 

Exemple 4-3: XInclude de fragments XML

<price-quote xmlns:xi="http://www.w3.org/2001/XInclude">
  <prepared-for>Joe Smith</prepared-for>
  <good-through>20040930</good-through>
  <xi:include href="price-list.xml"
 xpointer="w002-description"
/>
  <volume>40</volume>
  <xi:include href="price-list.xml" xpointer="element(w002-prices/2)
"/>
</price-quote>

4.3 Note: XML de base possède un simple système d'inclusion

Exemple

<?xml version="1.0" encoding="ISO-8859-1" ?>
<?xml-stylesheet href="ePBLbook10.xsl" version="1.0" type="text/xsl"?>
<!DOCTYPE book SYSTEM "ePBLpaper11.dtd"
 [
 <!ENTITY intro SYSTEM "intro-iris.xml">
 <!ENTITY file7 SYSTEM "paper7.xml">
 <!ENTITY file8 SYSTEM "paper8.xml">
 <!ENTITY file9 SYSTEM "paper9.xml">
 <!ENTITY file10 SYSTEM "paper10.xml">
 <!ENTITY file12 SYSTEM "paper12.xml">
 <!ENTITY file13 SYSTEM "paper13.xml">
 <!ENTITY file14 SYSTEM "paper14.xml">
]>
<book>
 &intro;
 &file7;
 &file8;
 &file9;
 &file10;
 &file12;
 &file13;
 &file14;
</book>

4.4 MathML

Exemple:

<b>Corollary 2</b> [Contractive Sequence Theorem] <em>If
<math xmlns='http://www.w3.org/1998/Math/MathML'><mo>(</mo><msub><mi>x</mi> <mi>n</mi></msub><mo>)</mo></math> is a sequence, for which there is a number <math xmlns='http://www.w3.org/1998/Math/MathML'><mi>C</mi><mi>&lt;</mi><mn>1</mn></math> such
that <math xmlns='http://www.w3.org/1998/Math/MathML'><mo>|</mo><msub><mi>x</mi> <mrow><mi>n</mi><mo>+</mo><mn>2</mn></mrow></msub><mo>-</mo><msub><mi>x</mi> <mrow><mi>n</mi><mo>+</mo><mn>1</mn></mrow></msub><mo>|</mo><mo>&le;</mo><mi>C</mi><mo>&sdot;</mo><mo>|</mo><msub><mi>x</mi> <mrow><mi>n</mi><mo>+</mo><mn>1</mn></mrow></msub><mo>-</mo><msub><mi>x</mi> <mi>n</mi></msub><mo>|</mo></math>, then <math xmlns='http://www.w3.org/1998/Math/MathML'><mo>(</mo><msub><mi>x</mi> <mi>n</mi></msub><mo>)</mo></math>

4.5 XLink

Exemple d'un simple xlink:

<RECIT xmlns:xlink="http://www.w3.org/1999/xlink">
.....
<paragraphe xlink:href="http://jigsaw.w3.org/css-validator/check/referer"
            xlink:type="simple">
    CSS Validator</paragraphe>

Voici la promesse (R = required, O = optional) :

 

Type d'attribut

Type de lien (exemple: <monlien xlink:type="locator" ... />

simple

extended

locator

arc

ressource

title

type

R

R

R

R

R

R

href

R

 

R

 

 

 

role

O

O

O

 

O

 

arcrole

O

 

 

O

 

 

title

O

O

O

O

O

 

show (comment?)

O

 

 

O

 

 

actuate (quand?)

O

 

 

O

 

 

label

 

 

O

 

O

 

from

 

 

 

O

 

 

to

 

 

 

O

 

 


UP PREVIOUS NEXT -- TIE