<?xml version="1.0" encoding="utf-8" ?>

<rss version="2.0" 
   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
   xmlns:admin="http://webns.net/mvcb/"
   xmlns:dc="http://purl.org/dc/elements/1.1/"
   xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
   xmlns:wfw="http://wellformedweb.org/CommentAPI/"
   xmlns:content="http://purl.org/rss/1.0/modules/content/"
   >
<channel>
    <title>:: handcode.de :: - XML</title>
    <link>http://www.handcode.de/blog/</link>
    <description>Jens sein blog</description>
    <dc:language>de</dc:language>
    <generator>Serendipity 1.5.3 - http://www.s9y.org/</generator>
    <pubDate>Fri, 01 Feb 2008 18:07:57 GMT</pubDate>

    <image>
        <url>http://www.handcode.de/images/logos/hc-144x22.png</url>
        <title>RSS: :: handcode.de :: - XML - Jens sein blog</title>
        <link>http://www.handcode.de/blog/</link>
        <width>144</width>
        <height>22</height>
    </image>

<item>
    <title>XSLT::registerPHPFunctions und &quot;NICHT-PHP&quot; XSLT-Prozessoren</title>
    <link>http://www.handcode.de/blog/archives/21-XSLTregisterPHPFunctions-und-NICHT-PHP-XSLT-Prozessoren.html</link>
            <category>PHP</category>
            <category>XML</category>
    
    <comments>http://www.handcode.de/blog/archives/21-XSLTregisterPHPFunctions-und-NICHT-PHP-XSLT-Prozessoren.html#comments</comments>
    <wfw:comment>http://www.handcode.de/blog/wfwcomment.php?cid=21</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://www.handcode.de/blog/rss.php?version=2.0&amp;type=comments&amp;cid=21</wfw:commentRss>
    

    <author>nospam@example.com (Jens Giessmann)</author>
    <content:encoded>
    PHP5 ermöglicht es mittels &lt;a href=&quot;http://de3.php.net/manual/de/function.xsl-xsltprocessor-register-php-functions.php&quot; title=&quot;www.php.net - XSLTProcessor::registerPHPFunctions&quot; target=&quot;_blank&quot;&gt;XSLTProcessor::registerPHPFunctions&lt;/a&gt; innerhalb von XSL-Stylesheets PHP Funktionen zu verwenden. Soweit, so gut...&lt;br /&gt;
&lt;dl&gt;
&lt;dt&gt;Dagegen spricht:&lt;/dt&gt;
&lt;dd&gt;Die Verwendung von PHP-Funktionen in XSL-Stylesheets ist &lt;em&gt;böse&lt;/em&gt;&lt;/dd&gt;
&lt;dd&gt;Mit der Verwendung von PHP-Funktionen in XSL-Stylesheets sind diese nicht mehr portabel&lt;/dd&gt;
&lt;dd&gt;...beliebige weitere (gute!) Gründe die gegen die Verwendung von PHP-Funktionen in XSL-Stylesheets sprechen&lt;/dd&gt;
&lt;dt&gt;Dafür spricht:&lt;/dt&gt;
&lt;dd&gt;Die Verwendung von PHP-Funktionen in XSL-Stylesheets ist &lt;strong&gt;praktisch&lt;/strong&gt; ;-)&lt;/dd&gt;
&lt;/dl&gt;&lt;br /&gt;
Mit einem kleinen &lt;em&gt;Trick&lt;/em&gt; ist es aber möglich XSL-Stylesheets zu schreiben, die auch mit &amp;quot;Nicht-PHP-XSLT-Prozessoren&amp;quot; wie z.B. &lt;a href=&quot;http://xmlsoft.org/XSLT/xsltproc.html&quot; title=&quot;xsltproc  command line xslt processor&quot; target=&quot;_blank&quot;&gt;xsltproc&lt;/a&gt; verarbeitet werden können, aber beim Einsatz von &lt;a href=&quot;http://de3.php.net/manual/de/ref.xsl.php&quot; title=&quot;www.php.net - XSL&quot; target=&quot;_blank&quot;&gt;PHP:XSL&lt;/a&gt; dennoch die Möglichkeiten der PHP-Funktionen zu nutzen.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;&lt;a href=&quot;http://www.handcode.de/blog/archives/21-XSLTregisterPHPFunctions-und-NICHT-PHP-XSLT-Prozessoren.html#extended&quot;&gt;&quot;XSLT::registerPHPFunctions und &amp;quot;NICHT-PHP&amp;quot; XSLT-Prozessoren&quot; vollständig lesen&lt;/a&gt;
    </content:encoded>

    <pubDate>Wed, 11 Apr 2007 18:24:00 +0200</pubDate>
    <guid isPermaLink="false">http://www.handcode.de/blog/archives/21-guid.html</guid>
    <category>php</category>
<category>programming</category>
<category>xml</category>
<category>xslt</category>

</item>
<item>
    <title>there is no attribute &quot;xmlns:php&quot;</title>
    <link>http://www.handcode.de/blog/archives/17-there-is-no-attribute-xmlnsphp.html</link>
            <category>PHP</category>
            <category>XML</category>
    
    <comments>http://www.handcode.de/blog/archives/17-there-is-no-attribute-xmlnsphp.html#comments</comments>
    <wfw:comment>http://www.handcode.de/blog/wfwcomment.php?cid=17</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://www.handcode.de/blog/rss.php?version=2.0&amp;type=comments&amp;cid=17</wfw:commentRss>
    

    <author>nospam@example.com (Jens Giessmann)</author>
    <content:encoded>
    Ja, mir ist klar, daß es grenzwertig ist, mittels &lt;a href=&quot;http://de3.php.net/manual/en/function.xsl-xsltprocessor-register-php-functions.php&quot; target=&quot;_blank&quot; title=&quot;php.net Funktions-Ref&quot;&gt;XSLTProcessor::registerPHPFunctions&lt;/a&gt; innerhalb von XSL-Stylesheets PHP Funktionen zu verwenden.&lt;br /&gt;
&lt;br /&gt;
Aber ab und an (z.B. für Syntax-highlighting von PHP-Code) ist es einfach zu praktisch um es nicht zu verwenden.&lt;br /&gt;
&lt;br /&gt;
Was mich aber wirklich gestört hat, ist der nicht valide XHTML-Code der dadurch erzeugt wurde.&lt;br /&gt;
&lt;br /&gt;
Im Output wurde teilweise die xmlns:php Definition als Attribut in Tags mit aufgenommen und das ist dann eben kein valider XHTML-Code mehr.&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;
Line 14 column 23: there is no attribute &quot;xmlns:php&quot;.
&amp;lt;div xmlns:php=&quot;http://php.net/xsl&quot; id=&quot;headermeta&quot;&amp;gt;
&lt;/pre&gt;&lt;br /&gt;
Wie so oft, nicht lange ärgern, lieber die Zeit mit Lesen verbringen, das bildet ;-)&lt;br /&gt;
&lt;br /&gt;
Irgendeinen Parameter in der Stylesheet, Template oder xsl:output Definition sollte es doch geben mit dem man das abstellen kann....&lt;br /&gt;
&lt;br /&gt;
Gibt es auch, und zwar als Parameter von &amp;lt;xsl:stylesheet&amp;gt;:&lt;br /&gt;
&lt;pre&gt;exclude-result-prefixes=&quot;php&quot;&lt;/pre&gt;&lt;br /&gt;
Eine komplette Stylesheet Definition mit PHP-Funktionen, EXSLT-Erweiterung&lt;br /&gt;
für XHTML-Output sieht dann z.B. so aus:&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;bb-code-title&quot;&gt;CODE:&lt;/div&gt;&lt;div class=&quot;bb-code&quot;&gt;&amp;#60;?xml&amp;#160;version=&quot;1.0&quot;&amp;#160;encoding=&quot;utf-8&quot;?&amp;#62;&amp;#160;&lt;br /&gt;
&amp;#60;xsl&amp;#58;stylesheet&amp;#160;version=&quot;1.0&quot;&amp;#160;&lt;br /&gt;
&amp;#160;&amp;#160;xmlns&amp;#58;xsl=&quot;http&amp;#58;//www.w3.org/1999/XSL/Transform&quot;&amp;#160;&lt;br /&gt;
&amp;#160;&amp;#160;xmlns&amp;#58;exsl=&quot;http&amp;#58;//exslt.org/common&quot;&amp;#160;&lt;br /&gt;
&amp;#160;&amp;#160;extension-element-prefixes=&quot;exsl&quot;&amp;#160;&lt;br /&gt;
&amp;#160;&amp;#160;xmlns&amp;#58;php=&quot;http&amp;#58;//php.net/xsl&quot;&amp;#160;&lt;br /&gt;
&amp;#160;&amp;#160;exclude-result-prefixes=&quot;php&quot;&amp;#160;&lt;br /&gt;
&amp;#160;&amp;#160;&amp;#62;&amp;#160;&lt;br /&gt;
&lt;br /&gt;
&amp;#160;&amp;#160;&amp;#60;xsl&amp;#58;output&amp;#160;method=&quot;xml&quot;&lt;br /&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;version=&quot;1.0&quot;&lt;br /&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;indent=&quot;yes&quot;&lt;br /&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;encoding=&quot;ISO-8859-1&quot;&lt;br /&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;omit-xml-declaration=&quot;no&quot;&lt;br /&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;media-type=&quot;text/xml&quot;&lt;br /&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;doctype-public=&quot;-//W3C//DTD&amp;#160;XHTML&amp;#160;1.0&amp;#160;Transitional//EN&quot;&lt;br /&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;doctype-system=&quot;http&amp;#58;//www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;/&amp;#62;&lt;br /&gt;
&lt;br /&gt;
&amp;#60;!--&amp;#160;.....&amp;#160;--&amp;#62;&lt;br /&gt;
&lt;br /&gt;
&amp;#60;/xsl&amp;#58;stylesheet&amp;#62;&lt;/div&gt;&lt;br /&gt;
 
    </content:encoded>

    <pubDate>Fri, 09 Mar 2007 14:21:48 +0100</pubDate>
    <guid isPermaLink="false">http://www.handcode.de/blog/archives/17-guid.html</guid>
    <category>php</category>
<category>programming</category>
<category>xml</category>
<category>xslt</category>

</item>
<item>
    <title>Variable Navigations-Listen mit PHP, XML und XSLT</title>
    <link>http://www.handcode.de/blog/archives/7-Variable-Navigations-Listen-mit-PHP,-XML-und-XSLT.html</link>
            <category>PHP</category>
            <category>XML</category>
    
    <comments>http://www.handcode.de/blog/archives/7-Variable-Navigations-Listen-mit-PHP,-XML-und-XSLT.html#comments</comments>
    <wfw:comment>http://www.handcode.de/blog/wfwcomment.php?cid=7</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://www.handcode.de/blog/rss.php?version=2.0&amp;type=comments&amp;cid=7</wfw:commentRss>
    

    <author>nospam@example.com (Jens Giessmann)</author>
    <content:encoded>
    ... oder, taugt XSLT als Templatesprache für die Ausgabelogik?&lt;br /&gt;
&lt;br /&gt;
Hier eine kleines Beispiel, wie man sehr einfach mit XSLT anhand eines gegebenen Wertes eine variable Ausgabe von (XML) Daten erzeugen kann. &lt;br /&gt;
&lt;br /&gt;
Als Beispielaufgabe soll hier mal eine Navigationsliste eines Intranets herhalten. &lt;br /&gt;
- Jeder User bekommt beim Login ein Berechtigungslevel&lt;br /&gt;
- Je nach Berechtigung des Users sollen nur die Teile der Navigation angezeigt werden für die der User auch eine Berechtigung hat.&lt;br /&gt;
- Die gesamte Navigation, mit allen insgesamt möglichen Items, soll aber nur einmal als XML/XHTML gepflegt werden müssen.&lt;br /&gt;
&lt;br /&gt;
Vorraussetzung ist PHP 5 ;-)&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;&lt;a href=&quot;http://www.handcode.de/blog/archives/7-Variable-Navigations-Listen-mit-PHP,-XML-und-XSLT.html#extended&quot;&gt;&quot;Variable Navigations-Listen mit PHP, XML und XSLT&quot; vollständig lesen&lt;/a&gt;
    </content:encoded>

    <pubDate>Tue, 09 Jan 2007 17:32:00 +0100</pubDate>
    <guid isPermaLink="false">http://www.handcode.de/blog/archives/7-guid.html</guid>
    <category>php</category>
<category>programming</category>
<category>xml</category>
<category>xslt</category>

</item>

</channel>
</rss>