Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <ol> <li><p>Add the following line to your XML just after the first line: </p> <p><code>&lt;?xml-stylesheet type="text/xsl" href="book.xsl"?&gt;</code></p> <p>And save if as <code>book.xml</code></p></li> <li><p>Edit your XSL file and save it as <code>book.xsl</code> in the same folder with your XML file</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"&gt; &lt;!-- You need a root xsl:template tag that matches the whole document --&gt; &lt;xsl:template match="/"&gt; &lt;xsl:apply-templates/&gt; &lt;/xsl:template&gt; &lt;xsl:template match="catalog"&gt; &lt;html&gt; &lt;head&gt; &lt;title&gt; &lt;xsl:text&gt;book&lt;/xsl:text&gt; &lt;/title&gt; &lt;/head&gt; &lt;body bgcolor="#ffffff"&gt; &lt;h1&gt; &lt;xsl:text&gt;Lieferungen&lt;/xsl:text&gt; &lt;/h1&gt; &lt;hr/&gt; &lt;table border="1"&gt; &lt;!-- I added thead and tbody just to make it prettier --&gt; &lt;thead&gt; &lt;tr&gt; &lt;th&gt;Nummer&lt;/th&gt; &lt;th&gt;author&lt;/th&gt; &lt;th&gt;titel&lt;/th&gt; &lt;th&gt;genre&lt;/th&gt; &lt;/tr&gt; &lt;/thead&gt; &lt;tbody&gt; &lt;xsl:apply-templates/&gt; &lt;/tbody&gt; &lt;/table&gt; &lt;hr/&gt; &lt;p&gt; &lt;xsl:text&gt;Mit Webfehler: Wie vermeidet man die falsch sortieren Spalten?&lt;/xsl:text&gt; &lt;/p&gt; &lt;/body&gt; &lt;/html&gt; &lt;/xsl:template&gt; &lt;xsl:template match="book"&gt; &lt;tr&gt; &lt;td&gt; &lt;xsl:value-of select="@id"/&gt; &lt;/td&gt; &lt;xsl:apply-templates/&gt; &lt;/tr&gt; &lt;/xsl:template&gt; &lt;xsl:template match="author|title|genre"&gt; &lt;td&gt; &lt;xsl:apply-templates/&gt; &lt;/td&gt; &lt;/xsl:template&gt; &lt;!-- If you do not need to output anything from these tags add an xsl:template that matches them and outputs nothing --&gt; &lt;xsl:template match="price|publish_date|description"&gt;&lt;/xsl:template&gt; &lt;/xsl:stylesheet&gt; </code></pre></li> <li><p>Open <code>book.xsl</code> in Firefox (it probably would also work in IE)</p></li> </ol>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload