130 likes | 314 Views
XML. Door Marick Manrho. Inhoud. Wat is XML? De opbouw van XML Wat is XSL? De opbouw van XSL Toepassing RSS. Wat is XML. XML is: Een markup language Gemaakt voor gegevens Kan opgevraagd worden in HTML Wordt opgemaakt met XSL bestand Komt voort uit SGML. De opbouw van XML.
E N D
XML Door MarickManrho
Inhoud • Wat is XML? • De opbouw van XML • Wat is XSL? • De opbouw van XSL • Toepassing RSS
Wat is XML XML is: • Een markup language • Gemaakt voor gegevens • Kan opgevraagd worden in HTML • Wordt opgemaakt met XSL bestand • Komt voort uit SGML
De opbouw van XML • Root element <?xmlversion=“1.0” encoding="UTF-8" ?> • Eigen tags <voorbeeld> </voorbeeld> <voorbeeld /> • Commentaar <!-- comentaar -->
<element_nameattribute_name="attribute_value">Element Content</element_name> • <recipename="bread" prep_time="5 mins" cook_time="3 hours"> • <title>Basic bread</title> • <ingredientamount="8" unit="dL">Flour</ingredient> • <ingredientamount="10" unit="grams">Yeast</ingredient> • <ingredientamount="4" unit="dL" state="warm">Water</ingredient> • <ingredientamount="1" unit="teaspoon">Salt</ingredient> • <instructions> • <step>Mix all ingredients together.</step> • <step>Knead thoroughly.</step> • <step>Cover with a cloth, and leave for one hour in warm room.</step> • <step>Knead again.</step> • <step>Place in a bread baking tin.</step> • <step>Cover with a cloth, and leave for one hour in warm room.</step> • <step>Bake in the oven at 180(degrees)C for 30 minutes.</step> • </instructions> • </recipe>
Wat is XSL? • Opmaak van XML • Meer dan CSS • Kan XML omzetten naar HTML • Twee verschillende types: • XSL:FO XSL FormattingObjects • XSLT XSL Transformations
Opbouw van XSL • Begint met aangepaste XML syntax • Kan elementen opvragen <xsl:value-of select="naam"/> • Sorteren op inhoud <xsl:for-each select="adresboek/persoon" order-by="naam">
<?xmlversion="1.0" ?> • - <xsl:stylesheetxmlns:xsl="http://www.w3.org/TR/WD-xsl"> • - <xsl:template match="/"> • - <html> • - <head> • <basefont face="Helvetica,Arial" color="#FFCC00" size="+1" /> • </head> • - <body bgcolor="#000066"> • - <table border="1"> • -<xsl:for-each select="adresboek/persoon" order-by="naam"> • - <tr> • - <tdalign="center"> • <xsl:value-of select="naam" /> • </xsl:for-each> • </table> • </body> • </html> • </xsl:template> • </xsl:stylesheet>
Toepassing RSS • Informatie beschikbaar maken • Andere opbouw
<rssversion="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel> <title>beursgegevens</title> <link>http://www.google.nl</link> <description>de beursgegevens van vandaag op de AEX index</description></channel></rss>
EINDE http://canada.esat.kuleuven.be/xmltutorial/hoofdstuk1.htm http://www.informatica-actief.nl/moodle/mod/resource/view.php?id=137 http://flarescue.org/images/graphics/xml-icon.png http://i.techrepublic.com.com/gallery/173832-500-495.jpg