我有一个Plone 3.5站点,我正在尝试将Collecting.xdv主题中的内容嵌入Simple Social的FB Like操作. FB Like函数嵌入在XML标记中
I have a Plone 3.5 site and I am trying to embedded Simple Social's FB Like action for a content in a collective.xdv theme. The FB Like function is embedded in an XML tag
<fb:like></fb:like>我正在尝试通过
//*[local-name()="like"]但是,我没有看到任何输出.以上是否在collective.xdv中受支持?还有另一种方法可以在XPATH中选择fb:like标签吗?
However, I do not see any output. Is the above supported in collective.xdv? Is there another way to select the fb:like tag in XPATH?
推荐答案lxml使用的libxml2 HTMLParser以及xdv/diazo去除了名称空间前缀,因此您应该能够使用"//like"来选择它.
The libxml2 HTMLParser used by lxml and thus xdv/diazo strips namespace prefixes, so you should be able to select it with "//like".
您将需要添加一些xslt代码来修复这些标记,因为必须对其进行渲染才能起作用:
You will need to add some xslt code to fix up those tags, as they must be rendered as in order to work:
<xsl:template match="activity|add-profile-tab|bookmark|comments|friendpile|like|like-box|live-stream|login-button|pronoun|recommendations|serverFbml|profile-pic|user-status"> <xsl:element name="fb:{local-name()}" xmlns:fb="www.facebook/2008/fbml"> <xsl:apply-templates select="@*|node()"/> </xsl:element> </xsl:template>虽然可以使xdv/diazo与XMLParser一起使用,然后您需要确保向文档中添加了xmlns:fb ="..."声明,并且所有输入都是有效的xhtml,这很困难以确保使用基于浏览器的html编辑器.
While xdv/diazo could be made to work with the XMLParser you would then need to ensure that you added an xmlns:fb="..." declaration to your document and that all your input was valid xhtml, which is difficult to ensure with browser based html editors.
劳伦斯
更多推荐
Collective.xdv中对local
发布评论