Les deux révisions précédentes Révision précédente Prochaine révision | Révision précédente |
slam:donneestructurees:le_format_xml_3 [2025/01/17 09:07] – dthevenot | slam:donneestructurees:le_format_xml_3 [2025/01/17 09:39] (Version actuelle) – [Observez un exemple et appliquez-le à votre bibliographie] dthevenot |
---|
====== Le XML (3) - mise en forme ====== | ====== Le XML (3) - mise en forme ====== |
<bootnote>Exécuter les fichiers depuis un serveur web personnel local, la plupart des navigateurs ont désactivé ou restreint la prise en charge des transformations xslt pour des raisons de sécurité</bootnote> | <bootnote>Exécuter les fichiers depuis un serveur web personnel local, la plupart des navigateurs ont désactivé ou restreint la prise en charge des transformations xslt pour des raisons de sécurité</bootnote> |
XSL (eXtensible Stylesheet Language) est un langage de style pour XML. | * **XSL** (eXtensible Stylesheet Language) est un langage de style pour XML. |
XSLT signifie Transformations XSL. XSLT permet de transformer des documents XML dans d'autres formats (comme transformer XML en HTML). | * **XSLT** signifie "Transformations XSL" : permet de transformer des documents XML dans d'autres formats (comme transformer XML en HTML par exemple). |
| |
===== XML et XSLT ===== | ===== XML et XSLT ===== |
<?xml version="1.0" encoding="UTF-8"?> | <?xml version="1.0" encoding="UTF-8"?> |
<html xsl:version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> | <html xsl:version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> |
<body style="font-family:Arial;font-size:12pt;background-color:#EEEEEE"> | <body style="font-family:Arial;font-size:12pt;background-color:#EEEEEE"> |
<h1>MENU</h1> | <h1>MENU</h1> |
<xsl:for-each select="breakfast_menu/food"> | <xsl:for-each select="breakfast_menu/food"> |
<div style="background-color:teal;color:white;padding:4px"> | <div style="background-color:teal;color:white;padding:4px"> |
<span style="font-weight:bold"><xsl:value-of select="name"/> - </span> | <span style="font-weight:bold"><xsl:value-of select="name"/> - </span> |
<xsl:value-of select="price"/> | <xsl:value-of select="price"/> |
</div> | </div> |
<div style="margin-left:20px;margin-bottom:1em;font-size:10pt"> | <div style="margin-left:20px;margin-bottom:1em;font-size:10pt"> |
<p> | <p> |
<xsl:value-of select="description"/> | <xsl:value-of select="description"/> |
<span style="font-style:italic"> (<xsl:value-of select="calories"/> calories per serving)</span> | <span style="font-style:italic"> (<xsl:value-of select="calories"/> calories per serving)</span> |
</p> | </p> |
</div> | </div> |
</xsl:for-each> | </xsl:for-each> |
</body> | </body> |
</html> | </html> |
</code> | </code> |