I'm creating a simple Diazo theme.
The rules.xml
is something like this:
<?xml version="1.0" encoding="UTF-8"?>
<rules
xmlns="http://namespaces.plone.org/diazo"
xmlns:css="http://namespaces.plone.org/diazo/css"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<theme href="index.html"/>
<replace css:content="#form-1" css:theme="#form-1" />
</rules>
And in a content file, there's the following lines:
...
<div id="form-1">
<form action="...">
<input type="text" id="name" />
<input type="submit" value="ok" />
</form>
</div>
....
I expected that these lines were replicated exactly in the same way in the output html. However, they became like this:
<div id="form-1">
<form action="...">
<input type="text" id="name" /><input type="submit" value="ok" /></form>
</div>
That is, every time I have an empty html tag, like <input ... />
or <br />
, the white space between it and the next tag is removed.
I've tried to modify this behaviour using <xsl:output>
and <xsl:preserve-space>
options, without success.
What can I do?
I'm facing this same issue. This is a bug.
Diazo uses lxml, a Python XML library. lxml uses 2 C libraries, libxml2 and libxslt. This is most likely a bug in one of these 2 libraries.
Quite possibly it is this bug:
https://bugzilla.gnome.org/show_bug.cgi?id=642191
The most obvious solution is to add some margin to the inputs in your CSS.
An alternative solution to editing your css would be to re-introduce the spaces in your rules file.
<replace css:content="#form-1 input">
<xsl:copy-of select="." /><xsl:value-of select="' '"/>
</replace>
This is a bit of a hack but works for me.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.