没有标题的输出xml片段 [英] output xml fragment without headers

查看:223
本文介绍了没有标题的输出xml片段的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我感觉自己很胖,但这是我的问题:

I have a feeling I'm being thick, but here's my problem:

我正在使用PHP创建动态XML树。这些树描述了员工的层次结构,文件目录等。它们构成了网页上内容的一小部分。网页的其余部分从其他各种来源(可能是基于SQL的文本,静态文本或某些特殊的表示形式类)粘合在一起。当我输出树时,我将XML转换为嵌套的< ul> 。我想输出< ul> 而没有任何文档类型/标题信息。 PHP的DomDocument和SimpleXML类似乎不允许这样做。在将< ul> 存储在字符串中之后,剥离掉违规信息的唯一选择是吗?

I'm creating dynamic XML trees using PHP. These trees describe employee hierarchies, file directories, etc. They comprise small sections of content on a webpage. The rest of the webpage is glued together from various other sources that may be SQL based, or static text or some special presentation class. When I go to output my trees, I transform the XML into a nested <ul>. I'd like to output that <ul> without any doctype/header info. PHP's DomDocument and SimpleXML classes don't seem to allow this. Is the only option to strip the offending info off after storing the <ul> in a string?

推荐答案

如果我放入< xsl:output method = html /> ,结果将不再输出自动DOCTYPE。问题已解决。

Turns out if I put <xsl:output method="html" /> I no longer output an automatic DOCTYPE. Problem solved.

这篇关于没有标题的输出xml片段的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆