| Author | Frank Steinberg |
| Keywords | XXHTML XSL Tags Elements Magic |
| Categories | Administrivia, Software |
General InformationThis page is generated from the stylesheet itself; every stylesheet of the site documents its constructs this way (see the links to the included stylesheets above, and how to write such documentation). The IBR web server is different from ordinary web servers or content management systems. If you intend to write or edit any content on the web server, it is helpful to understand a few concepts:
The content of XML documents is structured more or less as follows:
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="/xsl/show.xsl"?>
<html
xmlns="http://www.ibr.cs.tu-bs.de/xsd/xxhtml"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.ibr.cs.tu-bs.de/xsd/xxhtml
https://www.ibr.cs.tu-bs.de/xsd/xxhtml.xsd">
<head>
<title lang="de">Beispiel</title>
<title lang="en">Example</title>
</head>
<body>
<p>
...
</p>
</body>
</html>
In combination with some default CSS definitions, the resulting web pages appear in a consistent design based on less redundant and thus more consistent XML files than with usual handcrafted HTML documents. Some abilities built into the supplied stylesheets take also care of consistent web page menus, bi-language support, time or user based filtering, etc. Multi-Language SupportIn some cases it might be useful to put additional effort in your documents to supply it in multiple languages, mainly in german and in english. This can be done within one file, so that it easy for the author to keep a consistent structure for both languages. You just have to add "lang" attributes to those elements, which should appear only in a given language. Elements without a "lang" attribute appear in any language. See the example above, which contains a title in two languages, while the rest of the document is not multi-langual. If you use multi-language support, you should always supply an english variant (lang="en"), since this is the fallback language for any client language which is not supported by your document. Time-based FilteringMost (but not all) elements may contain the attributes "start" and/or "end", which allow to supply a starting or ending point in time, when this element (and its content) shall be rendered. This might be useful for course registration forms, special announcements, etc. The timestamps have to be given ISO format (yyyy-mm-ddThh:mm:ss).
<p start="2005-07-20T00:00:00" end="2005-07-20T23:59:00">
Dieser Absatz soll nur am 20.07.2005 sichtbar sein!
</p>
User-based Filtering
Most (but not all) elements may contain the attributes "user" or
"group", so that their content is only rendered if the client
user has logged in and matches the given username or is a member
of the given group. The special case Symbol Pictures
A page may have a wide picture on its top: a file next to the page
(or a URL), named in the head of the document. Old documents name a
picture of the TU's former "Medien-DB" (names in
<meta name="symbolpic" content="banner.jpg" alt="Our lab"/>
A Menu of Its Own, the Look of an Article
A part of the site with pages that belong together (a manual, the
documentation of xcm at
<meta name="menu" content="menu.xml"/>
<meta name="layout" content="article"/>
Markdown Pages
Instead of an XML document, a page can be written in Markdown: a
file
---
title: Beispiel
---
Ein Absatz mit **fett** und einem [Link](other.html).
> Achtung
{.is-warning}
More Help
Special anchors (<a ...>, not Schema-specific)<a class="mail"/>Generates an anchor (<a ...>) to an email address given by the href attribute (either with or without the mailto: prefix). If the text content of the element is empty, the plain email address will be used as the visible content of the anchor. <a class="man" sect="x"/>Generates an anchor (<a ...>) to a man page named by the text content of the <a> element and optionally detailed to the section given by the sect attribute. <a class="kb"/>Generates an anchor (<a ...>) to a knowledge base article given by the idref attribute. <a class="room" idref="xxx"/>Generates an anchor (<a ...>) to a given room. As of September 2007 only rooms on the first and second floor of the computer science building which belong the IBR are available this way. They have to be identified by a three-digit number through the idref attribute. If the element is empty, a default label will be generated, e.g. "Room 131". Alternatively, an explicit label can be given as a contained text node. The generated link points to a page which shows a floor map where the given room is marked. Special <div> and <span> sections (not Schema-specific)<span class="title"/>Generates a <span> section containing the document's title in the currently chosen language. On pages that shall contain a headline, it is suggested to specify a title in <head> and reference it by this element within a <h1> element at the beginning of the <body>:
...
<head>
<title lang="de">Beispiel</title>
<title lang="en">Example</title>
</head>
<body>
<h1><span class="title"/></h1>
...
<div class="xsldoc" href="/xsl/user.xsl"/>Embeds the documentation for authors of the stylesheet given by the href attribute into a page. A stylesheet's documentation can also be read as a page of its own, e.g. /xsl/user.xsl?xslt=/xsl/xsldoc.xsl. <div class="toc"/>A table of contents of the page: every <h2> and <h3> with an id attribute that follows the element, in the current language (headings with lang, or inside an element with it, count only in that language; a heading for both languages may hold <span lang="de"> and <span lang="en"> - ids have to be unique), as links to the headings. Headings without id are left out, since they cannot be linked to. The heading of the box is "Inhalt" or "Contents"; a title attribute replaces it.
<div class="toc"/>
<h2 id="install"><span lang="de">Einrichtung</span><span lang="en">Installation</span></h2>
<div class="schemadoc" href="/xsd/course.xsd"/>The fields of a kind of document, from its XML Schema: the name and description of the kind, then a table of its elements and attributes (nested ones indented) with the label, how often it may occur, its type (with the allowed values of a list, with their labels) and the hint of the edit form, in the current language. Taken from the annotations of the schema (appinfo: new/name, new/about, label, hint), so it is always the one the server checks against. Elements whose content is XXHTML show "XXHTML"; types of xsd/xcm.xsd are looked up there. <pre class="mermaid">...</pre>A diagram (flow chart, sequence diagram, Gantt chart, ...) in the Mermaid syntax, drawn in the browser. The page loads the Mermaid library only if it contains such an element; without JavaScript, the text of the diagram is shown. In Markdown pages, a code block ```mermaid becomes the same.
<pre class="mermaid">
flowchart LR
author["Author"] -- "saves" --> xcmd["xcmd"] -- "renders" --> page["Page"]
</pre>
<div class="qrcode"/>Generates a <div> section containing a QR code image of the current page URL or of the div's content. <div class="now"/>Generates a <div> section containing the current date and time in ISO format. <div class="result" href="result.xml"/>
Generates a form allowing a user to query results of an exam.
The results have to be stored in a <div class="resultstats" href="result.xml"/>Generates a <div> section containing the result statistics of an exam. <div class="rooms" [idref="xxx"]/> (Query String Parameters: room, floor, building)Generates a <div> section containing a floor map of a given builing and floor and optionally with a marked room. As of September 2007, only the building 4103 (Informatikzentrum) and the first and second floor with the rooms that belong to IBR are implemented. If a room number is identified either through an XSLT template parameter named room (passed from the web server via a query string parameter) or through the idref attribute, that room is marked on the map. Special lists (<ul>, <ol>) and tables (<table>, <tr>)The following forms of lists and tables can be used to render a dynamic set of items which conform to a given class (i.e., XML Schema). In any case, the items are specified either through the XPath expression given in a select attribute (it should usually be of the form CLASS:CLASS[...]), or by a search form with the same class, if the searchresult="true" attribute is present. In the latter case, the document must also contain this search form:
<div>
<form class="search"/>
</div>
The search is done by xcmd, so the files have to be below the
directories it serves and readable for the user who views the page.
The CLASS is the root element of the files (with its namespace
prefix), e.g. bibitem, transponder, hardware, event, project, thesis,
course, user, issue, news, talk, tracked-paper, list; its namespace
has to be known to xcmd ( <ul class="CLASS" [directory="dir"] [select="xxx"] [searchresult="true"] [sort="xxx" [order="ascending|descending"]]/>Generates an unnumbered list (<ul>...) of items of a given CLASS. The following example lists all bibitems, that were authored or co-authored by the IBR user "strauss", sorted by the bibitems' sub-elements which specify the publication date. Note the two types of quoting characters (' and ").
<ul class="bibitem"
select='//bibitem:bibitem[contains(bibitem:ibrauthors,"strauss")]'
sort='concat(document(@href)/bibitem:bibitem/bibitem:year,
document(@href)/bibitem:bibitem/bibitem:month)'
order="descending">
</ul>
<ol class="CLASS" [directory="dir"] [select="xxx"] [searchresult="true"] [sort="xxx" [order="ascending|descending"]]/>
Generates an ordered list (<ul>...) of items of a
given CLASS. The following example shows an input form for a
search pattern followed by an ordered list of search results.
As long as no search string is given, the result list is filled
with the search result given by the
<div>
<form class="search"/>
</div>
<ol class="bibitem"
directory="/bib"
searchresult="true"
select='//bibitem:bibitem[bibitem:loaned = "$HTTP_REMOTE_USER"]'
sort="concat(document(@href)/*/bibitem:year,
document(@href)/*/bibitem:month)"
order="descending"/>
<div class="CLASS" [directory="dir"] [select="xxx"] [searchresult="true"] [sort="xxx" [order="ascending|descending"]]/>Generates an list of div's of items of a given CLASS. <table class="CLASS" [directory="dir"] [select="xxx"] [searchresult="true"] [sort="xxx" [order="ascending|descending"]]/>Generates a table of items of a given CLASS. The following example lists all theses in a table, that were supervised by the IBR user "strauss". Note the two types of quoting characters (' and ").
<table class="thesis"
directory="/theses/strauss"
select='//thesis:thesis[thesis:supervisor = "strauss"]'/>
<table class="generic"> ...Generates a table that contains data from a given XML document. Rendered columns and the sorting order can be configured. The configuration is achieved through a containing <colgroup> element that specifies the XML document and the attribute used for sorting the rows, and through a number of containing <col> elements that specify the columns to be rendered, either subelement or attributes. (This functionality might be changed soon.)
<table class="generic">
<colgroup href="list.xml" sort="name">
<col select="@date"/>
<col select="gender"/>
<col select="name"/>
<col select="firstname"/>
<col select="matrikel"/>
<col select="course"/>
<col select="comment"/>
<col select="semester"/>
<col select="email"/>
</colgroup>
</table>
The XML document has to have an arbitrary root element representing a list. On the second level an arbitrary number of elements represent the records that are rendered as table rows. Their attributes and their containing third-level elements can be rendered as the records' columnar cells which are selected and ordered by the cols. <form class="search" href="xxx"/>Generates a <form> for entering search patterns. Search results are rendered through other <table> elements on the same page, see above. Currently, only one search form and result is supported on the same page. <commment>...</commment>If you want to include comments in the result XHTML document, you can use this element in the source XML document.
| |
Vacancies of TU Braunschweig
Career Service' Job Exchange
Merchandising
Term Dates
Courses
Degree Programmes
Information for Freshman
TUCard
Technische Universität Braunschweig
Universitätsplatz 2
38106 Braunschweig
P. O. Box: 38092 Braunschweig
GERMANY
Phone: +49 (0) 531 391-0