XSLT不会允许我使用自闭式img和br标签 [英] XSLT wont allow me to use self-closing img and br tags
问题描述
我有一些在Sitecore 6 CMS中呈现的XSLT,但我不认为这个问题是特定于产品的。
如果我有自动关闭img或br标记,如下所示:
< br />>
< img src =your.example.com/>
结果输出为:
<峰; br>
< img src =your.example.com>
XSLT文件的输出方法是HTML。它应该是XML吗?我在猜测自闭标签不是有效的HTML,但将它设置为XML会在输出中产生问题?这很好。您选择HTML,HTML中允许< br>
标签。选择XML,然后你会得到你想要的。
是的,如果你想要自闭标签,你应该使用XML方法。我猜你想要XHTML输出,而XHTML是一个XML文档。
I have some XSLT that gets rendered in the Sitecore 6 CMS, but I don't think that this issue is specific to the product.
If I have a self-closing img or br tag, like so:
<br />
<img src="your.example.com" />
The resulting output would be:
<br>
<img src="your.example.com">
The output method of the XSLT file is HTML. Is it supposed to be XML? I'm guessing that self-closing tags are not valid HTML, but is setting it to XML going to cause problems in my output?
That is just fine. You choose HTML, and <br>
tags are allowed in HTML. Choose XML and then you will have what you want.
And yes, you should use XML method if you want self-closing tags. I'm guessing you want XHTML output, and XHTML is a XML document.
这篇关于XSLT不会允许我使用自闭式img和br标签的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!