Skip to content

Commit bec0ad8

Browse files
Initial commit
0 parents  commit bec0ad8

File tree

10 files changed

+215
-0
lines changed

10 files changed

+215
-0
lines changed

.gitattributes

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Auto detect text files and perform LF normalization
2+
* text=auto

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# tp-xml-biblio
2+

biblio.dtd

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<!ELEMENT biblio (etudiant+)>
2+
<!ELEMENT etudiant (livre+)>
3+
<!ELEMENT livre EMPTY>
4+
<!ATTLIST etudiant
5+
code CDATA #REQUIRED
6+
nom CDATA #REQUIRED
7+
prenom CDATA #REQUIRED>
8+
<!ATTLIST livre
9+
id NMTOKEN #REQUIRED
10+
dateEmrunt CDATA #REQUIRED
11+
titre CDATA #REQUIRED
12+
rendu (OUI|NON) 'NON'>

biblio.html

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
<html>
2+
<body>
3+
<h3> Liste des emprunts de livres </h3>
4+
<ul>
5+
<li>elhaayoub</li>
6+
<table border="1" width="80%">
7+
<tr>
8+
<th>ID</th>
9+
<th>TITRE</th>
10+
<th>DATE</th>
11+
<th>RENDU</th>
12+
</tr>
13+
<tr>
14+
<td>L1</td>
15+
<td>boite</td>
16+
<td>2022-11-11</td>
17+
<td>OUI</td>
18+
</tr>
19+
<tr>
20+
<td>L2</td>
21+
<td>XML</td>
22+
<td>2021-11-11</td>
23+
<td>NON</td>
24+
</tr>
25+
<tr>
26+
<td colspan="3">Nombre de livres empruntes</td>
27+
<td>2</td>
28+
</tr>
29+
<tr>
30+
<td colspan="3">Nombre de livres non rendu</td>
31+
<td>1</td>
32+
</tr>
33+
</table>
34+
<hr>
35+
<li>banhamza</li>
36+
<table border="1" width="80%">
37+
<tr>
38+
<th>ID</th>
39+
<th>TITRE</th>
40+
<th>DATE</th>
41+
<th>RENDU</th>
42+
</tr>
43+
<tr>
44+
<td>L3</td>
45+
<td>PHP</td>
46+
<td>2019-09-22</td>
47+
<td>NON</td>
48+
</tr>
49+
<tr>
50+
<td colspan="3">Nombre de livres empruntes</td>
51+
<td>1</td>
52+
</tr>
53+
<tr>
54+
<td colspan="3">Nombre de livres non rendu</td>
55+
<td>1</td>
56+
</tr>
57+
</table>
58+
<hr>
59+
</ul>
60+
</body>
61+
</html>

biblio.xml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE biblio SYSTEM "file:/C:/Users/user/Desktop/Master/Enset/s7/xml/biblio/biblio.dtd">
3+
<?xml-stylesheet type="text/xsl" href="biblio.xsl"?>
4+
<biblio>
5+
<etudiant code="e1" nom="elha" prenom="ayoub" >
6+
<livre id="L1" dateEmrunt="2022-11-11" rendu="OUI" titre="boite" />
7+
<livre id="L2" dateEmrunt="2021-11-11" rendu="NON" titre="XML" />
8+
</etudiant>
9+
<etudiant code="e2" nom="ban" prenom="hamza">
10+
<livre id="L3" dateEmrunt="2019-09-22" rendu="NON" titre="PHP"/>
11+
</etudiant>
12+
</biblio>

biblio.xsd

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
3+
<xsd:element name="biblio">
4+
<xsd:complexType>
5+
6+
<xsd:sequence>
7+
<xsd:element name="etudiant" minOccurs="1" maxOccurs="unbounded" type="TYPE_ETUDIANT" >
8+
</xsd:element>
9+
</xsd:sequence>
10+
11+
</xsd:complexType>
12+
13+
14+
</xsd:element>
15+
<xsd:complexType name="TYPE_ETUDIANT">
16+
<xsd:sequence>
17+
<xsd:element name="livre" minOccurs="0" maxOccurs="unbounded" type="TYPE_LIVRE">
18+
19+
</xsd:element>
20+
</xsd:sequence>
21+
<xsd:attribute name="code" type="xsd:string" use="required" ></xsd:attribute>
22+
<xsd:attribute name="nom" type="xsd:string" use="required" ></xsd:attribute>
23+
<xsd:attribute name="prenom" type="xsd:string" use="optional"></xsd:attribute>
24+
<xsd:attribute name="age" >
25+
<xsd:simpleType>
26+
<xsd:restriction base="xsd:int">
27+
<xsd:minInclusive value="16"></xsd:minInclusive>
28+
<xsd:maxInclusive value="65"></xsd:maxInclusive>
29+
</xsd:restriction>
30+
</xsd:simpleType>
31+
32+
</xsd:attribute>
33+
</xsd:complexType>
34+
35+
36+
<xsd:complexType name="TYPE_LIVRE">
37+
38+
<xsd:attribute name="id" type="xsd:ID" use="required"></xsd:attribute>
39+
<xsd:attribute name="titre" type="xsd:string" use="required"></xsd:attribute>
40+
<xsd:attribute name="dateEmprunt" type="xsd:date" use="required" ></xsd:attribute>
41+
<xsd:attribute name="rendu" default="NON" >
42+
<xsd:simpleType>
43+
<xsd:restriction base="xsd:string">
44+
<xsd:enumeration value="OUI" ></xsd:enumeration>
45+
<xsd:enumeration value="NON" ></xsd:enumeration>
46+
</xsd:restriction>
47+
</xsd:simpleType>
48+
</xsd:attribute>
49+
50+
</xsd:complexType>
51+
</xsd:schema>

biblio.xsl

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
3+
xmlns:xs="http://www.w3.org/2001/XMLSchema"
4+
exclude-result-prefixes="xs"
5+
version="2.0">
6+
<xsl:template match="/" >
7+
<html>
8+
9+
<body>
10+
<h3> Liste des emprunts de livres </h3>
11+
<ul>
12+
<xsl:for-each select="biblio/etudiant">
13+
<li><xsl:value-of select="@nom" />
14+
<xsl:value-of select="@prenom" /></li>
15+
16+
<table border="1" width="80%">
17+
<tr>
18+
<th>ID</th><th>TITRE</th><th>DATE</th><th>RENDU</th>
19+
</tr>
20+
<!-- <xsl:for-each select="livre[@rendu='NON']"> -->
21+
<xsl:for-each select="livre">
22+
<tr>
23+
<td>
24+
<xsl:value-of select="@id" />
25+
</td>
26+
<td>
27+
<xsl:value-of select="@titre" />
28+
</td>
29+
<td>
30+
<xsl:value-of select="@dateEmrunt" />
31+
</td>
32+
<td>
33+
<xsl:value-of select="@rendu" />
34+
</td>
35+
</tr>
36+
</xsl:for-each>
37+
38+
<tr>
39+
<td colspan="3" >Nombre de livres empruntes</td>
40+
<td> <xsl:value-of select="count(livre)" /> </td>
41+
</tr>
42+
<tr>
43+
<td colspan="3" >Nombre de livres non rendu</td>
44+
<td> <xsl:value-of select="count(livre[@rendu='NON'])" /> </td>
45+
</tr>
46+
</table>
47+
<hr/>
48+
</xsl:for-each>
49+
50+
</ul>
51+
</body>
52+
</html>
53+
</xsl:template>
54+
</xsl:stylesheet>

biblio2.xsd

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<xs:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
3+
4+
<xsd:element name="biblioh">
5+
6+
</xsd:element>
7+
8+
</xs:schema>

biblio2XSD.xml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<biblio xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xsi:noNamespaceSchemaLocation="file:/C:/Users/user/Desktop/Master/Enset/s7/xml/biblio/biblio.xsd">
4+
<etudiant code="E1" nom="ELHANNAOUI" prenom="Ayoub" age="16" >
5+
<livre id="ID-1" titre="LA BOITE A MERVEILLE" dateEmprunt="2022-11-10" rendu="NON" />
6+
<livre id="ID-2" titre="LA BOITE A MERVEILLE" dateEmprunt="2022-11-10" rendu="NON" />
7+
<livre id="ID-3" titre="LA BOITE A MERVEILLE" dateEmprunt="2022-11-10" rendu="NON" />
8+
<livre id="ID-4" titre="LA BOITE A MERVEILLE" dateEmprunt="2022-11-10" rendu="NON" />
9+
</etudiant>
10+
<etudiant code="E2" nom="ELHANNAOUI" prenom="Ayoub" age="16" >
11+
<livre id="ID-5" titre="LA BOITE A MERVEILLE" dateEmprunt="2022-11-10" rendu="NON" />
12+
</etudiant>
13+
</biblio>

images/Capture.JPG

192 KB
Loading

0 commit comments

Comments
 (0)