Frage zu TAL EXAMPLE
"A.A." <[email protected]> Mon, 17 Jan 2005 13:42:25 +0200
| Newsgroups | gmane.comp.cms.bitflux.general.german |
|---|---|
| Message-ID | <[email protected]> |
Guten Tag,
eine Frage zum TAL EXAMPLE
also ich habe den folgendem quellcode:
TAL Template
<?xml version="1.0" ?>
<html xmlns:tal="http://xml.zope.org/namespaces/tal" xmlns="http://www.w3.org/1999/xhtml">
<head >
<title tal:content="document/header/title">Here comes the title</title>
</head>
<body>
<h1 tal:content="document/header/title"></h1>
<p class="note">The layout of this HTML page is defined doc2html-template.xhtml</p>
<div class="content" tal:repeat="s1 /document/body/s1">
<div class="s1">
<h2 tal:content="$s1/@title">S1 Title</h2>
<div tal:replace="structure $s1/node()"> content</div>
</div>
</div>
</body>
</html>
Content.xml
<?xml version="1.0" ?>
<document>
<header>
<title>Page Title</title>
</header>
<body>
<s1 title="Section 1 Title">
<p>
Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
Etiam pharetra, metus quis lobortis pulvinar, turpis lacus
tristique augue, sit amet ultrices mi massa quis odio.
</p>
<p>
Curabitur <b>turpis</b>. Donec lobortis ornare orci.
</p>
</s1>
<s1 title="Section 2 Title">
<p>
Das ist ein <i>Blindtext</i> und hat keinerlei Bedeutung.
Das ist ein Blindtext und hat keinerlei Bedeutung.
</p>
</s1>
</body>
</document>
Wie komme ich zu den folgendem output. Wie gehts weiter?
XHTML Output
<?xml version="1.0" encoding="utf-8"?>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Page Title</title>
</head>
<body>
<h1>Page Title</h1>
<p class="note">The layout of this HTML page is defined doc2html-template.xhtml</p>
<div class="content">
<div class="s1">
<h2>Section 1 Title</h2>
<p>
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Etiam pharetra, metus quis lobortis pulvinar, turpis lacus tristique augue, sit amet ultrices mi massa quis odio.
</p>
<p>
Curabitur <b>turpis</b>. Donec lobortis ornare orci.
</p>
</div>
<div class="s1">
<h2>Section 2 Title</h2>
<p>
Das ist ein <i>Blindtext</i> und hat keinerlei Bedeutung. Das ist ein Blindtext und hat keinerlei Bedeutung.
</p>
</div>
</div>
</body>
</html>
Wenn ich ein xsl template haette wurde ich den folgeden code schreiben
<?php
$xml = new DomDocument;
$xml->load('file.xml');
$xsl = new DomDocument;
$xsl->load('file.xsl');
$proc = new xsltprocessor;
$proc->importStyleSheet($xsl);
echo $proc->transformToXML($xml);
?>
das gleiche geht mit TAL nicht und mit
tal2xsl weiss ich nicht wie ich es benutzten kann
Ich Danke euch
Apostolos Anagnostopoulos