-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Whitespace breaks xsl:attribute when Modifying theme on-the-fly #52
Comments
My initial reaction is to just close this as whitespace is significant in html and diazo puposefully preserves it - the whitespace following the We do currently special case blank text node children of xsl elements: https://github.com/plone/diazo/blob/1.2.2/lib/diazo/emit-stylesheet.xsl#L261-L271 so perhaps an argument could be made for special casing blank text nodes that immediately lead or follow an xsl element. That would change behaviour of code like this though: <replace css:theme="#welcome">
<p>Hello <include css:content="#username"/></p>
</replace> |
Thanks for the quick response, Lawrence. Let me see if I understand. Are you saying that in order to make room for my proposed usecase the result of your example rule would be If that's an XSL limitation then we should just document it better, since this syntax seems to differ from HTML nodes expected behavior. |
I got my example case slightly wrong as it would only affect whitespace only text nodes: <replace css:theme-content="#welcome">
<b>Hello</b> <xsl:value-of select="$username"/>
</replace> Currently it produces |
Does it make sense to add such a special case? or should we just improve documentation? |
This works:
This does not:
Even this won't work (one single whitespace before xsl:attribute):
Here's the error msg:
_runtime error, element 'attribute' [123:0]
xsl:attribute: Cannot add attributes to an element if children have been already added to the element. [0:0]_
Using Plone 4.3.
/cc @ebrehault @davisagli @lrowe
The text was updated successfully, but these errors were encountered: