<?php
header("Content-type:text/html;charset=utf-8");
$name = $_POST["name"];
$xslDoc = new DOMDocument();
$xslDoc->load("view.xsl");
$xmlDoc = new DOMDocument();
$xmlDoc->load("view.xml");
$xmlDom = new DOMDocument('1.0','utf-8');
$xmlDom->loadXML("<?xml version='1.0' encoding='utf-8'?><views></views>");
$notes = $xmlDom->documentElement;
foreach ($xmlDoc->getElementsByTagName('name') as $note) {
if ($note->nodeValue == $name) {
$temp = $note;
$name = $temp->nodeValue;
$temp = $temp->nextSibling->nextSibling;
$introduction = $temp->nodeValue;
$temp = $temp->nextSibling->nextSibling;
$temp = $temp->childNodes;
$note = $notes->appendChild($xmlDom->createElement('view'));
$note->appendChild($xmlDom->createElement('name',$name));
$note->appendChild($xmlDom->createElement('introduction',$introduction));
$no = $note->appendChild($xmlDom->createElement('picture'));
foreach($temp as $node){
if ($node->nodeName != "#text") {
$no->appendChild($xmlDom->createElement('list', $node->nodeValue));
}
}
}
}
//进行XSL转换
$proc = new XSLTProcessor();
$proc->importStylesheet($xslDoc);
echo $proc->transformToXML($xmlDom);
?>
可爱小男孩
- 粉丝: 4
- 资源: 1
会员权益专享
最新资源
- 很棒的毕业设计、课程设计、练手的java项目-仓库商品管理系统(文档+视频+源码).rar
- 用MATLAB进行血管骨架提取,包括血管分割技术,去除背景
- 小马哥STM32F103C8T6四轴飞行器资料(包含源代码和教程)
- 架空输电线路鸟巢检测图像数据集(200张图像,VOC标签)
- 课程设计、毕业设计以及练手的优质java项目-网络购物系统(struts+hibernate).rar
- 不错的PHP毕业设计项目-图片共享系统.rar
- 夏宇闻 Verilog数字系统设计教程 练习及对应练习题代码
- php最新威客任务平台完整源码+码支付
- 网页设计作业-学生作品-爱宠之家-官网.rar
- 不错的delphi课程设计项目-家庭财务管理系统.rar
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈


