Also Irgendwie nimmt er meine if Anweisungen nicht richtig an.
Einmal macht der Compiler es richtig dann mal wieder nicht.
Die Konten haben auch keine Leerezeichen.
Gibt es hier auch noch eine Andere Möglichkeit?
PHP-Code:
< ? xml version = '1.0' encoding = 'utf-8' ? >
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" encoding="ISO-8859-15" />
<xsl:variable name="newline">
<xsl:text>
</xsl:text>
</xsl:variable>
<xsl:template match="list">
<xsl:for-each select="SingleFieldset">
<fieldset>
<xsl:attribute name="class">
<xsl:text>SingleFieldset</xsl:text>
</xsl:attribute>
<legend>
<xsl:attribute name="class">
<xsl:text>LegendTitle</xsl:text>
</xsl:attribute>
<strong><xsl:value-of select="LegendTitle" /></strong>
</legend>
<!-- Inline:Boxset -->
<div>
<xsl:attribute name="class">
<xsl:text>InlineFormBox</xsl:text>
</xsl:attribute>
<xsl:for-each select="InlineFormBox/DisplayName">
<div>
<xsl:attribute name="class">
<xsl:text>DisplayName</xsl:text>
</xsl:attribute>
<xsl:value-of select="." />
</div>
</xsl:for-each>
<xsl:value-of select="$newline" />
<!-- float:left -->
<div>
<xsl:attribute name="class">
<xsl:text>LeftToRight</xsl:text>
</xsl:attribute>
<xsl:attribute name="style">
<xsl:text>width: 45%;</xsl:text>
</xsl:attribute>
<!-- Adresse -->
<pre>
<xsl:attribute name="style">
<xsl:text>text-align: left</xsl:text>
</xsl:attribute>
<xsl:value-of select="InlineFormBox/LeftToRight/BlockSatz" />
</pre>
<xsl:if test="InlineFormBox/LeftToRight/LeftToRight">
<div>
<xsl:attribute name="class">
<xsl:text>LeftToRight</xsl:text>
</xsl:attribute>
<a>
<xsl:attribute name="target">
<xsl:text>_blank</xsl:text>
</xsl:attribute>
<xsl:attribute name="class">
<xsl:text>DefLink</xsl:text>
</xsl:attribute>
<xsl:attribute name="href">
<xsl:value-of select="InlineFormBox/LeftToRight/LeftToRight" />
</xsl:attribute>
<xsl:text>Homepage</xsl:text>
</a>
</div>
</xsl:if>
<xsl:if test="InlineFormBox/LeftToRight/RightToLeft">
<div>
<xsl:attribute name="class">
<xsl:text>RightToLeft</xsl:text>
</xsl:attribute>
<a>
<xsl:attribute name="target">
<xsl:text>_blank</xsl:text>
</xsl:attribute>
<xsl:attribute name="class">
<xsl:text>DefLink</xsl:text>
</xsl:attribute>
<xsl:attribute name="href">
<xsl:value-of select="InlineFormBox/LeftToRight/RightToLeft" />
</xsl:attribute>
<xsl:text>E-Mail</xsl:text>
</a>
</div>
</xsl:if>
<!-- clear:both -->
<div>
<xsl:attribute name="class">
<xsl:text>Spacer</xsl:text>
</xsl:attribute>
<xsl:comment>Opera/IE Bugfix</xsl:comment>
</div>
</div>
<xsl:value-of select="$newline" />
<!-- float:right -->
<div>
<xsl:attribute name="class">
<xsl:text>RightToLeftCenter</xsl:text>
</xsl:attribute>
<xsl:attribute name="style">
<xsl:text>width: 45%;</xsl:text>
</xsl:attribute>
<xsl:choose>
<xsl:when test="InlineFormBox/RightToLeftCenter/WappenImg">
<img>
<xsl:attribute name="src">
<xsl:value-of select="InlineFormBox/RightToLeftCenter/WappenImg" />
</xsl:attribute>
<xsl:attribute name="width">
<xsl:value-of select="InlineFormBox/RightToLeftCenter/width" />
</xsl:attribute>
<xsl:attribute name="height">
<xsl:value-of select="InlineFormBox/RightToLeftCenter/height" />
</xsl:attribute>
<xsl:attribute name="class">
<xsl:text>imgsep</xsl:text>
</xsl:attribute>
</img>
</xsl:when>
<xsl:otherwise>
<xsl:comment>Kein Bild</xsl:comment>
</xsl:otherwise>
</xsl:choose>
</div>
<xsl:value-of select="$newline" />
<!-- clear:both -->
<div>
<xsl:attribute name="class">
<xsl:text>Spacer</xsl:text>
</xsl:attribute>
<xsl:comment>Opera/IE Bugfix</xsl:comment>
</div>
</div>
</fieldset>
<xsl:value-of select="$newline" />
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
PHP-Code:
$bgm = new Adressen();
$addr = $bgm->DisplayAdressen( "ürgermeister" );
$xsl = new XSLTProcessor;
$dom = new DOMDocument( '1.0' );
$dom->load( DATASET . "/xslt/Adressen.xslt" );
$xsl->importStyleSheet( $dom );
$dom->loadXML( $addr );
$o = $xsl->transformToXML( $dom );
Lesezeichen