XSP indent

Having trouble installing Oxygen? Got a bug to report? Post it all here.
jh

XSP indent

Post by jh »

Hi,

I just dowloaded oxygen and tried some of oxygen's features. I have several xsp pages and thus opened one and first thing that came in mind was to indent it because it spreaded all over the page (tabs were to big). But after indent, the whole xsp thing got even worse:

<xsp:logic>
String role = request.getParameter("role");
String roleFrag = <xsp-session-fw:getxml context="authentication" path="/authentication/role" as="string"/>;

ends up as:
<xsp:logic> String role = request.getParameter("role"); String roleFrag =
<xsp-session-fw:getxml context="authentication" path="/authentication/role"
as="string"/>;

or:
<xsp:logic>
if (evenRow)
{
<Attributes class="EvenRow"/>
}

ends up as:
<xsp:logic> if (evenRow) { <Attributes class="EvenRow"/> } else {

Seems that with after the <xsp:logic> tag, everything is backed up against it, messing up/breaking the code.
I would like oxygen to leave the none-tag stuff as is (or only shift the tabs more to the left/right).

Kind Regards
JH
george
Site Admin
Posts: 2095
Joined: Thu Jan 09, 2003 2:58 pm

Post by george »

Hi,

Oxygen allows a high degree of configuration for document formatting. It also provides a "light" indenting implementation in the "Indent selection" action from the contextual menu that just adds or removes whitespaces at or from the beginning of each line. For instance a document like (please note that one line will get wrapped below by the forum software, in oXygen it is not wrapped):

Code: Select all


<?xml version="1.0" encoding="UTF-8"?>
<test>

<xsp:logic>
String role = request.getParameter("role");
String roleFrag = <xsp-session-fw:getxml context="authentication" path="/authentication/role" as="string"/>;
</xsp:logic>
<xsp:logic>
if (evenRow)
{
<Attributes class="EvenRow"/>
}
</xsp:logic>
</test>
will became:

Code: Select all


<?xml version="1.0" encoding="UTF-8"?>
<test>

<xsp:logic>
String role = request.getParameter("role");
String roleFrag = <xsp-session-fw:getxml context="authentication" path="/authentication/role" as="string"/>;
</xsp:logic>
<xsp:logic>
if (evenRow)
{
<Attributes class="EvenRow"/>
}
</xsp:logic>
</test>
If you add the xsp:logic element in the preserve spaces elements list then the formatting action will act exactly as if an xml:space="preserve" would be added to that element giving you something like the sample below on the same test document:

Code: Select all


<?xml version="1.0" encoding="UTF-8"?>
<test>
<xsp:logic>
String role = request.getParameter("role");
String roleFrag = <xsp-session-fw:getxml context="authentication" path="/authentication/role" as="string"/>;
</xsp:logic>
<xsp:logic>
if (evenRow)
{
<Attributes class="EvenRow"/>
}
</xsp:logic>
</test>
Hope that helps,
George
Post Reply