是否可以删除基本和内容类型 +改变 Diazo 中的 HTML 属性?
我正在尝试使用 plone.app.theming 1.0b8 从 Plone 站点使用 Diazo 制作 HTML5/CSS3 主题。它在身体部分就像魅力一样发挥作用。但HTML标签和HEAD部分比较困难。至少对我来说:)
我尝试过:
- 删除 HTML 标签中的 xmlns 和 xml:lang 属性
<drop attributes="xmlns xml:lang" theme="/html/" />
- 删除基本标签
<drop theme="/html/head/base/" />
- 删除元标签,其中 http-equiv="Content-Type"
<drop theme="/html/head/meta[@http-equiv='Content-Type']" />
我想知道 plone.app.theming 或 Diazo 是强制这些东西进入输出,或者如果我的 xpath 有问题?我四处寻找但没有找到答案。
BR
I am trying to make a HTML5/CSS3 theme with Diazo from a Plone site, using plone.app.theming 1.0b8. It is working like a charm in the BODY part. But the HTML tag and HEAD part are more difficult. To me at least :)
I have tried to:
- remove xmlns and xml:lang attributes in the HTML tag
<drop attributes="xmlns xml:lang" theme="/html/" />
- remove base tag
<drop theme="/html/head/base/" />
- remove meta tag where http-equiv="Content-Type"
<drop theme="/html/head/meta[@http-equiv='Content-Type']" />
I am wondering if plone.app.theming or Diazo is forcing these things into the output, or if it's my xpath which is buggy? I have searched around but found no answers.
BR
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您的 xpath 可能不应该以尾随“/”结尾,尽管我认为这不是问题所在。
无法删除 xmlns 属性,因为该属性是由 XMLSerializer 在 XHTML 模式下添加的(至少在常见情况下)。您可以在根规则标记内使用
设置 HTML 序列化。在XHTML模式下,XMLSerializer将添加一个xml:lang来匹配lang属性。再次尝试设置 html 序列化。
通常,基本标签会从内容复制到主题中 - 主题 html 文件中不应该有基本标签。如果不复制它,它就不会出现在输出中。但是,建议始终在 Zope 的输出中包含基本标记,因为同一页面将在
http://localhost/some_url
和http://localhost/some_url/< /code>,这将导致与任何相对 url 的差异。
libxslt 添加的内容类型标头是 libxslt 无条件添加的,并且无法抑制。
Your xpaths probably should not end with a trailing '/', though I don't think this is the problem here.
It won't be possible to remove the xmlns attribute as that is added by XMLSerializer in XHTML mode (at least under common circumstances). You could set an HTML serialization instead with
<xsl:output method="html"/>
inside your root rules tag.In XHTML mode, the XMLSerializer will add an xml:lang to match the lang attribute. Again, try setting the html serialization.
Normally the base tag gets copied from the content into the theme - there ought to be no reason to have a base tag in a theme html file. If you don't copy it over, it won't end up in the output. However it is advisable to always include a base tag in output from Zope as the same page will be rendered at both
http://localhost/some_url
andhttp://localhost/some_url/
, which will lead to differences with any relative urls.The content-type header is added by libxslt is unconditionally added by libxslt and is impossible to suppress.