To comment on David's statement:
"Indents and pretty formatting don't affect the html rendering -- at least
not that I've ever noticed."
They do...Seriously...I have a proof with my strict XHTML 1.1 page...


However, I actually found a way to preserve the spaces and formatting
Using 

<jsp:text>
<![CDATA[

Stuff here

]]>
</jsp:text>


Will preserve every space...the only thing is my template will be riddled
with these as there are (frequently!) tags and scriplets I need...

So for example above if I wanted to do 


<jsp:text>
<![CDATA[
Stuff above
<br/>
<cms:mainBar paragraph="page-properties" label="Page Properties"
adminButtonVisible="true"/>
<br/>
Stuff below

]]>
</jsp:text>


It wouldn't work...I have to do 

<jsp:text>
<![CDATA[
Stuff above
<br/>
]]>
</jsp:text>

<cms:mainBar paragraph="page-properties" label="Page Properties"
adminButtonVisible="true"/>

<jsp:text>
<![CDATA[
<br/>
Stuff below
]]>
</jsp:text>



Very annoying...but it works...







-----Original Message-----
From: [email protected] [mailto:[EMAIL PROTECTED] 
Sent: Thursday, March 08, 2007 4:38 PM
To: [email protected]
Subject: Re: [magnolia-user] JSP Documents - preserving spaces

One way would be to not use the "xml syntax" of jsp ;)

On 08 Mar 2007, at 22:21, David Smith wrote:

> I guess you mean certain tags which require an end tag are  
> truncated to
> the self-terminating form.
>
> Example:
> <script type="javascript" src="/docroot/js/myjavascript.js"></script>
> becomes
> <script type="javascript" src="/docroot/js/myjavascript.js"/>
>
> Indents and pretty formatting don't affect the html rendering -- at
> least not that I've ever noticed.
>
> Sorry, but I can't find any way to turn-off the auto-collapse
> "feature".  For div, script, and other tags that require a separate  
> end
> tag you could place an empty comment in to prevent the jsp engine from
> collapsing the tag.  That's what's generally done in the sample
> templates.  Just need something other than the standard space  
> character
> to prevent the empty tag from being collapsed.
>
> <script type="javascript" src="/docroot/js/myjavascript.js"></script>
> becomes
> <script type="javascript" src="/docroot/js/myjavascript.js"><!--
> --></script>
>
> --David
>
> Amir Mistric wrote:
>> Hi all
>>
>>
>> Our web developers designed a page (XHTML 1.1 compliant) which I  
>> am trying
>> to set up as a template.
>> The page on its own displays correctly and passes all validations.
>> However when create a template (which is a valid JSP document  
>> (.jspx)) the
>> layout breaks.
>>
>> After some time, I believe I figured out that the reason why the  
>> layout
>> breaks is because spaces are not being preserved when the content  
>> renders.
>>
>> As a matter of fact I took the HTML code produced by Magnolia and  
>> created a
>> plain web page and it was broken. After cleaning up a broken page and
>> reformatting with spaces everything was back to normal...
>>
>>
>> The question...
>>
>> How do I "tell" the JSP/JSPX template to preserve the spaces and  
>> comments
>> and indentation?
>>
>>
>> Any help is appreciated...
>>
>> Regards
>>
>> Amir
>>
>>
>>
>
>
> ----------------------------------------------------------------
> for list details see
> http://www.magnolia.info/en/developer.html
> ----------------------------------------------------------------


----------------------------------------------------------------
for list details see
http://www.magnolia.info/en/developer.html
----------------------------------------------------------------


----------------------------------------------------------------
for list details see
http://www.magnolia.info/en/developer.html
----------------------------------------------------------------

Reply via email to