Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Aphorismen
Applications
Business Economics & Admin.
My Computers
Cooking
Devices
Folders
Food
Hardware
Infos
Software Development
Sports
Operation Instructions
Todos
Test
Help
Glossary
Community portal
adaptions
Sidebar anpassen
Wiki RB4
Search
Search
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
XML
(section)
Page
Discussion
English
Read
Edit
View history
Toolbox
Tools
move to sidebar
hide
Actions
Read
Edit
View history
General
What links here
Related changes
Special pages
Page information
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==XSL (Extensible Style Language)== XSL documents are made of rules that are applied to XML documents, so its possible to transform XML to HTML. XSL hat drei Teile: *eine Transformationssprache (XSLT) *eine Sprache, um Teile von XML Dokumenten zu definieren (XPath) *ein Vokabular, um XML Dokumente zu formatieren. ===XSLT=== In der Praxis werden XML Dateien zunächst transformiert und dann formatiert. XSLT transformiert ein XML-Dokument in ein anderes bzw. ein source tree in ein result tree. In the transformation process, XSLT uses XPath to define parts of the source document that match one or more predefined templates. When a match is found, XSLT will transform the matching part of the source document into the result document. The parts of the source document that do not match a template will end up unmodified in the result document. ===Aufbau einer XSL-Datei=== In der XSL-Datei befinden sich die Anweisungen, wie die Elemente, die in der XML-Datei stehen, dargestellt werden. Es können auch Funktionen, wie Schleifen und Sortieren verwendet werden. Dies ist ein großer Vorteil gegenüber HTML. In der XSL-Datei kann auch noch Text geschrieben werden, der dann einfach ausgegeben wird. Dies ist besonders praktisch bei Überschriften usw. Auch das von HTML bekannte JavaScript ist verwendbar, man muss jedoch beachten, daß es auch ausgeführt wird. XSL-Dateien sind wohl geformte XML-Dateien. Der Kopf der XSL-Datei hat eine gewisse Ähnlichkeit mit einer XML-Datei, da auch sie mit der Definition der XML-Version beginnt. Auch hier ist es im Moment noch die Version "1.0". In der nächsten Zeile gibt man dann an, welchen Stylesheet man benutzt. WICHTIG Die Stylesheet-Definition muss am Ende der Datei unbedingt wieder geschlossen werden, da es sonst zum Fehler kommt. <?xml version="1.0"?> <xsl:stylesheet xlmns:xsl="http://www.w3.org/TR/WD-xsl"> ...Stylesheet.... </xsl.stylesheet> Eine XSL-Datei besteht aus verschiedenen Regeln. Jede Regel beschreibt, für ein Element, wie es dargestellt werden soll. Hier werden Elemente gleichen Namens zusammengefasst. Am Anfang beginnt man am Besten mit einer Regel, die alle Elemente durchlaufen, da man so nicht jedes Mal eine Regel zu schreiben braucht. Dieses Element beschreibt man mit "/". Man muss beachten, daß jedes Element erst einmal aufgerufen werden muss, damit es bearbeitet wird. Dafür wird das Tag <xsl:apply-templates/> benutzt. Dies ist immer der gleiche Kopf. Nun fangen wir mit dem sogenannten Root-Element an. Hier können wir erstmal ein Standard-Format angeben. Hier können wir auch schon die Überschrift "Vorname" und "Nachname" angeben, und mit dem Aufbau der Tabelle beginnen.
Summary:
Please note that all contributions to Wiki RB4 may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Uwe Heuer Wiki New:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Toggle limited content width