doulin2025 2017-03-29 21:47
浏览 77
已采纳

使用XSLT merge 2 XML,它来自PHP transformToXML

I am beginner in PHP, XSLT. Found solution for transform XML using XSLT:

$xml = Array2XML::createXML('Document', $result);
$xsl = new DOMDocument;
$xsl->load('Teema.xsl');
$processor = new XSLTProcessor();
$processor->importStyleSheet($xsl);
$results=$processor->transformToXML($xml);
$results=$processor->transformToUri($xml,"NewTeema.xml" );

But, what to do if I have 2 or more XMLs? This $xml is not file, and I dont want to save each xml, like file on server (because it is was converted response json). Any ideas?

  • 写回答

2条回答 默认 最新

  • doudouxuqh198138 2017-03-29 23:49
    关注

    In the XSLT you can load additional document using the document() function.

    Another possibility is to register a PHP function that loads the file and returns the value or DOM node.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)
编辑
预览

报告相同问题?

手机看
程序员都在用的中文IT技术交流社区

程序员都在用的中文IT技术交流社区

专业的中文 IT 技术社区,与千万技术人共成长

专业的中文 IT 技术社区,与千万技术人共成长

关注【CSDN】视频号,行业资讯、技术分享精彩不断,直播好礼送不停!

关注【CSDN】视频号,行业资讯、技术分享精彩不断,直播好礼送不停!

客服 返回
顶部