Is it possible to remove base and Content-Type + alter HTML attributes in Diazo?

StackOverflow https://stackoverflow.com/questions/6831468

  •  27-10-2019
  •  | 
  •  

문제

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

도움이 되었습니까?

해결책

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 and http://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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top