Parse error: syntax error, unexpected T_STRING in /usr/local/waf7-we

JAVA_STU 2010-05-04 10:07:15
我在用dhtmlx控件进行开发的时候,需要解析的xml文件出现以下异常,如何解决?

<b>Parse error</b>: syntax error, unexpected T_STRING in <b>/usr/local/waf7-web/waf7web/app/views/route/get_route_xml.thtml</b> on line <b>1</b><br />


其中get_route_xml.thtml文件内容如下:

<?xml version="1.0" encoding="UTF-8"?>
<rows>
<?php
foreach ($croutes as $key => $route) {
?>
<row id="<?php echo $key; ?>">
<userdata name="nh_type"><?php echo $route['nh_type']; ?></userdata>
<cell><?php echo $key; ?></cell>
<cell><![CDATA[<?php echo $route['dst_ip']; ?>]]></cell>
<cell><![CDATA[<?php echo $route['distance']; ?>]]></cell>
<cell><![CDATA[<?php echo $route['nh_ip']; ?>]]></cell>
<cell><![CDATA[<?php echo $route['weigh']; ?>]]></cell>
</row>
<?php
}
?>
</rows>
...全文
264 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
JAVA_STU 2010-05-04
  • 打赏
  • 举报
回复
[Quote=引用 1 楼 xuzuning 的回复:]
你启用了短标签功能

于是,<?xml version="1.0" encoding="UTF-8"?>
要用php语句输出
echo '<?xml version="1.0" encoding="UTF-8"?>';
[/Quote]

在哪里设置是否启动短标签功能呢?

xuzuning 2010-05-04
  • 打赏
  • 举报
回复
你启用了短标签功能

于是,<?xml version="1.0" encoding="UTF-8"?>
要用php语句输出
echo '<?xml version="1.0" encoding="UTF-8"?>';
xuzuning 2010-05-04
  • 打赏
  • 举报
回复
php.ini中
; Allow the <? tag. Otherwise, only <?php and <script> tags are recognized.
; NOTE: Using short tags should be avoided when developing applications or
; libraries that are meant for redistribution, or deployment on PHP
; servers which are not under your control, because short tags may not
; be supported on the target server. For portable, redistributable code,
; be sure not to use short tags.
short_open_tag = Off

21,881

社区成员

发帖
与我相关
我的任务
社区描述
从PHP安装配置,PHP入门,PHP基础到PHP应用
社区管理员
  • 基础编程社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧