Ben bir xml doc bir xsl dosyası uygulamak çalışıyorum. i bunu ancak, hiçbir şey gösterir. i xml dosyasından xsl başvuruyu kaldırmak durumunda, veriler en azından görüntülenir.
Bu xsl kodu:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<div>
<div style="background:red;"><xsl:value-of select="title"/></div>
<div style="background:green;"><p><xsl:value-of select="introduction"/></p></div>
<div style="background:blue;"><xsl:for-each select="verse">
<div><xsl:value-of select="p"/></div> <br />
<div><xsl:value-of select="trla"/></div> <br />
<div><xsl:value-of select="trli"/></div> <br />
</xsl:for-each>
</div>
</div>
</xsl:template>
</xsl:stylesheet>
xml:
<root>
<title></title>
<introduction></introduction>
<verse>
<p></p>
<trla></trla>
<trli></trli>
</verse>
</root>
ve xml php denir ediliyor html:
<div id="display">
<?php
error_reporting(E_ALL);
ini_set("display_errors", 1);
$xmldoc = new DOMDocument();
if(!file_exists('test.xml')){
echo "Sorry this file does not exists!";
exit();
} else {
$xmldoc->load('test.xml', LIBXML_NOBLANKS);
$activities = $xmldoc->firstChild->firstChild;
if($activities != null){
while($activities != null){
?>
<div id="xml">
<span>
<?php echo $activities->textContent ?> </li></ul></span> <br />
</div>
<?php
$activities = $activities->nextSibling;
}
}
}
?>
</div>