Hallo Forum,
ich versuche mich gerade an XSLT. Zur Konvertierung nach html benutze ich saxon.
Leider wird eine html Datei generiert die 0 Byte groß ist. Weiß nicht was ich falsch mache.
Liegt es am Befehl?
C:\saxon>saxon8.jar c:\xmltest\agb.xml c:\xmltest\agb.xsl >agb.html
Ich denke nicht. Weiß jemand Rat?
agb.xml
----------
<?xml version="1.0" encoding="utf-8" standalone="no" ?>
<!DOCTYPE agb SYSTEM "/dtd/agb.dtd">
<?xml-stylesheet type="text/css" href="styles.css"?>
<agb date="01.01.2002" updated="01.01.2005">
<section name="Allgemeines" number="1.0">
<p>blah blah</p>
</section>
</agb>
agb.dtd
--------------------
<!DOCTYPE [ agb
<!ELEMENT agb (topic)+>
<!ELEMENT section (subtopic | p)+>
<!ELEMENT p (#PCDATA)>
<!ATTLIST agb
date NMTOKEN #REQUIRED
updated NMTOKEN #REQUIRED
<!ATTLIST section
name CDATA #REQUIRED
number CDATA #REQUIRED
]]>
agb.xsl
-----------------
<?xml version="1.0" encoding="iso-8859-1"?>
<?xsl-stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<html>
<head>
<title>Testconversion</title>
</head>
<body style="color: green;">
<xsl:apply-templates />
</body>
</html>
</xsl:template>
<xsl:template match="section">
<xsl:apply-templates />
</xsl:template>
<xsl:template match="p">
<div style="border: 1px solid #000;"><xsl:value-of select="." /></div>
</xsl:template>
</xsl:stylesheet>