Php XSLTProcessor ile Problem

0 Cevap php

Ben DITA Open Toolkit 's XSLT dosyaları dayalı bir. Dita dosyasından xhtmli oluşturmak için php XSLTProcessor class kullanmaya çalışıyorum.

XSLTProcessor (samples wikipedia örn.) basit XML ve XSLT dosyaları ile çalışıyor, ancak Open Toolkit'ın xsls ile başarısız olur.

Intresting bölüm (Ben hiçbir anahtarları kullanılır) aynı dosya üzerinde aynı bilgisayarda bash xsltproc komutunu kullanırsanız her şey iyi çalışıyor olmasıdır.

Yani, burada benim kod:

<?php
$sXML = file_get_contents('concepts/tools.xml');
# LOAD XML FILE
$XML = new DOMDocument();
$XML->loadXML( $sXML );

# START XSLT
$xslt = new XSLTProcessor();
$XSL = new DOMDocument();

$XSL->load( 'xsl/dita2xhtml.xsl');
$xslt->importStylesheet( $XSL );
#PRINT
print $xslt->transformToXML( $XML );

Ve yerine xhtml geçerli dosyanın Ben böyle bir çıktı:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE span PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<span style="background-color: yellow;"><span style="font-weight: bold">[/concept
     {""}) </span>
<span style="background-color: yellow;"><span style="font-weight: bold">[/concept/title
     {""}) </span>Tools<span style="font-weight: bold"> (title]</span></span>
<span style="background-color: yellow;"><span style="font-weight: bold">[/concept/shortdesc
     {""}) </span>Invest in a good set of tools for doing all kinds of tasks around the house.<span style="font-weight: bold"> (shortdesc]</span></span>
<span style="background-color: yellow;"><span style="font-weight: bold">[/concept/conbody
     {""}) </span><span style="background-color: yellow;"><span style="font-weight: bold">[/concept/conbody/p
     {""}) </span>Useful tools include the following items:<span style="font-weight: bold"> (p]</span></span> (...)

Bu çıkış, sadece ilk parçası, ama ben burada tüm metni kopyalamak istemedim.

Xsl dosyası ve dita hem de konsept dosya Dita Açık Toolkit olduğunu.

Herhangi bir fikir ne yanlış?

0 Cevap