You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@velocity.apache.org by "Kevin Swanson (JIRA)" <de...@velocity.apache.org> on 2011/01/03 16:47:45 UTC

[jira] Created: (VELOCITY-792) Template if statement throws off tabbing

Template if statement throws off tabbing
----------------------------------------

                 Key: VELOCITY-792
                 URL: https://issues.apache.org/jira/browse/VELOCITY-792
             Project: Velocity
          Issue Type: Bug
         Environment: Eclipse IDE. 
Microsoft XP.
            Reporter: Kevin Swanson


When using a velocity template for XML output. I encounter tabbing issues when using an IF statement. Below you can find an example of what is happening:

Template which produces erroneous tabbing:

#foreach($order in $orderList)
		<type>
    			#if("$order.type" == "AZ")
    			<AZ>
                            <fiveYears>$order.typeVar1</fiveYears>
                            <thirtyNineMonths>$order.typeVar2</thirtyNineMonths>
                        </AZ>
                        #end
               </type>
#end

Output of erroneous tabbing:
				<type>
    				    				<AZ>
                        <fiveYears>true</fiveYears>
                        <thirtyNineMonths>false</thirtyNineMonths>
                    </AZ>
                               </type>

If I remove the indentation from the #if and #end then the output is normal. Having to remove the indentation is undesirable as it makes the template difficult to read.

Template with removed indentation for #if and #end:

#foreach($order in $orderList)
		<type>
#if("$order.type" == "AZ")
    			<AZ>
                            <fiveYears>$order.typeVar1</fiveYears>
                            <thirtyNineMonths>$order.typeVar2</thirtyNineMonths>
                        </AZ>
#end
               </type>
#end

Output with indentation for #if and #end removed;
		<type>
    		    <AZ>
                        <fiveYears>true</fiveYears>
                        <thirtyNineMonths>false</thirtyNineMonths>
                    </AZ>
                </type>

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
For additional commands, e-mail: dev-help@velocity.apache.org


[jira] Updated: (VELOCITY-792) Template if statement throws off tabbing

Posted by "Kevin Swanson (JIRA)" <de...@velocity.apache.org>.
     [ https://issues.apache.org/jira/browse/VELOCITY-792?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Kevin Swanson updated VELOCITY-792:
-----------------------------------

    Description: 
When using a velocity template for XML output. I encounter tabbing issues when using an IF statement. Below you can find an example of what is happening:

Template which produces erroneous tabbing:

#foreach($order in $orderList)
		<type>
    			#if("$order.type" == "AZ")
    			<AZ>
                            <fiveYears>$order.typeVar1</fiveYears>
                            <thirtyNineMonths>$order.typeVar2</thirtyNineMonths>
                        </AZ>
                        #end
               </type>
#end

Output of erroneous tabbing:
				<type>
    				    				<AZ>
                        <fiveYears>true</fiveYears>
                        <thirtyNineMonths>false</thirtyNineMonths>
                    </AZ>
                               </type>

If I remove the indentation from the #if and #end then the output is normal. Having to remove the indentation is undesirable as it makes the template difficult to read.

Template with removed indentation for #if and #end:

#foreach($order in $orderList)
		<type>
#if("$order.type" == "AZ")
    			<AZ>
                            <fiveYears>$order.typeVar1</fiveYears>
                            <thirtyNineMonths>$order.typeVar2</thirtyNineMonths>
                        </AZ>
#end
               </type>
#end

Output with indentation for #if and #end removed;
		<type>
    		    <AZ>
                        <fiveYears>true</fiveYears>
                        <thirtyNineMonths>false</thirtyNineMonths>
                    </AZ>
                </type>

  was:
When using a velocity template for XML output. I encounter tabbing issues when using an IF statement. Below you can find an example of what is happening:

Template which produces erroneous tabbing:

#foreach($order in $orderList)
		<type>
    			#if("$order.type" == "AZ")
    			<AZ>
                            <fiveYears>$order.typeVar1</fiveYears>
                            <thirtyNineMonths>$order.typeVar2</thirtyNineMonths>
                        </AZ>
                        #end
               </type>
#end

Output of erroneous tabbing:
				<type>
    				    				<AZ>
                        <fiveYears>true</fiveYears>
                        <thirtyNineMonths>false</thirtyNineMonths>
                    </AZ>
                               </type>

If I remove the indentation from the #if and #end then the output is normal. Having to remove the indentation is undesirable as it makes the template difficult to read.

Template with removed indentation for #if and #end:

#foreach($order in $orderList)
		<type>
#if("$order.type" == "AZ")
    			<AZ>
                            <fiveYears>$order.typeVar1</fiveYears>
                            <thirtyNineMonths>$order.typeVar2</thirtyNineMonths>
                        </AZ>
#end
               </type>
#end

Output with indentation for #if and #end removed;
				<type>
    				<AZ>
                        <fiveYears>true</fiveYears>
                        <thirtyNineMonths>false</thirtyNineMonths>
                    </AZ>
                </type>


Trying to fix tabbing to show properly.

> Template if statement throws off tabbing
> ----------------------------------------
>
>                 Key: VELOCITY-792
>                 URL: https://issues.apache.org/jira/browse/VELOCITY-792
>             Project: Velocity
>          Issue Type: Bug
>         Environment: Eclipse IDE. 
> Microsoft XP.
>            Reporter: Kevin Swanson
>
> When using a velocity template for XML output. I encounter tabbing issues when using an IF statement. Below you can find an example of what is happening:
> Template which produces erroneous tabbing:
> #foreach($order in $orderList)
> 		<type>
>     			#if("$order.type" == "AZ")
>     			<AZ>
>                             <fiveYears>$order.typeVar1</fiveYears>
>                             <thirtyNineMonths>$order.typeVar2</thirtyNineMonths>
>                         </AZ>
>                         #end
>                </type>
> #end
> Output of erroneous tabbing:
> 				<type>
>     				    				<AZ>
>                         <fiveYears>true</fiveYears>
>                         <thirtyNineMonths>false</thirtyNineMonths>
>                     </AZ>
>                                </type>
> If I remove the indentation from the #if and #end then the output is normal. Having to remove the indentation is undesirable as it makes the template difficult to read.
> Template with removed indentation for #if and #end:
> #foreach($order in $orderList)
> 		<type>
> #if("$order.type" == "AZ")
>     			<AZ>
>                             <fiveYears>$order.typeVar1</fiveYears>
>                             <thirtyNineMonths>$order.typeVar2</thirtyNineMonths>
>                         </AZ>
> #end
>                </type>
> #end
> Output with indentation for #if and #end removed;
> 		<type>
>     		    <AZ>
>                         <fiveYears>true</fiveYears>
>                         <thirtyNineMonths>false</thirtyNineMonths>
>                     </AZ>
>                 </type>

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
For additional commands, e-mail: dev-help@velocity.apache.org


[jira] Updated: (VELOCITY-792) Template if statement throws off tabbing

Posted by "Kevin Swanson (JIRA)" <de...@velocity.apache.org>.
     [ https://issues.apache.org/jira/browse/VELOCITY-792?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Kevin Swanson updated VELOCITY-792:
-----------------------------------

    Description: 
When using a velocity template for XML output. I encounter tabbing issues when using an IF statement. Below you can find an example of what is happening:

Template which produces erroneous tabbing:

#foreach($order in $orderList)
		<type>
    			#if("$order.type" == "AZ")
    			<AZ>
                            <fiveYears>$order.typeVar1</fiveYears>
                            <thirtyNineMonths>$order.typeVar2</thirtyNineMonths>
                        </AZ>
                        #end
               </type>
#end

Output of erroneous tabbing:
				<type>
    				    				<AZ>
                        <fiveYears>true</fiveYears>
                        <thirtyNineMonths>false</thirtyNineMonths>
                    </AZ>
                               </type>

If I remove the indentation from the #if and #end then the output is normal. Having to remove the indentation is undesirable as it makes the template difficult to read.

Template with removed indentation for #if and #end:

#foreach($order in $orderList)
		<type>
#if("$order.type" == "AZ")
    			<AZ>
                            <fiveYears>$order.typeVar1</fiveYears>
                            <thirtyNineMonths>$order.typeVar2</thirtyNineMonths>
                        </AZ>
#end
               </type>
#end

Output with indentation for #if and #end removed;
		            <type>
    		                <AZ>
                        <fiveYears>true</fiveYears>
                        <thirtyNineMonths>false</thirtyNineMonths>
                    </AZ>
                </type>

  was:
When using a velocity template for XML output. I encounter tabbing issues when using an IF statement. Below you can find an example of what is happening:

Template which produces erroneous tabbing:

#foreach($order in $orderList)
		<type>
    			#if("$order.type" == "AZ")
    			<AZ>
                            <fiveYears>$order.typeVar1</fiveYears>
                            <thirtyNineMonths>$order.typeVar2</thirtyNineMonths>
                        </AZ>
                        #end
               </type>
#end

Output of erroneous tabbing:
				<type>
    				    				<AZ>
                        <fiveYears>true</fiveYears>
                        <thirtyNineMonths>false</thirtyNineMonths>
                    </AZ>
                               </type>

If I remove the indentation from the #if and #end then the output is normal. Having to remove the indentation is undesirable as it makes the template difficult to read.

Template with removed indentation for #if and #end:

#foreach($order in $orderList)
		<type>
#if("$order.type" == "AZ")
    			<AZ>
                            <fiveYears>$order.typeVar1</fiveYears>
                            <thirtyNineMonths>$order.typeVar2</thirtyNineMonths>
                        </AZ>
#end
               </type>
#end

Output with indentation for #if and #end removed;
		    <type>
    		        <AZ>
                        <fiveYears>true</fiveYears>
                        <thirtyNineMonths>false</thirtyNineMonths>
                    </AZ>
                </type>


> Template if statement throws off tabbing
> ----------------------------------------
>
>                 Key: VELOCITY-792
>                 URL: https://issues.apache.org/jira/browse/VELOCITY-792
>             Project: Velocity
>          Issue Type: Bug
>         Environment: Eclipse IDE. 
> Microsoft XP.
>            Reporter: Kevin Swanson
>
> When using a velocity template for XML output. I encounter tabbing issues when using an IF statement. Below you can find an example of what is happening:
> Template which produces erroneous tabbing:
> #foreach($order in $orderList)
> 		<type>
>     			#if("$order.type" == "AZ")
>     			<AZ>
>                             <fiveYears>$order.typeVar1</fiveYears>
>                             <thirtyNineMonths>$order.typeVar2</thirtyNineMonths>
>                         </AZ>
>                         #end
>                </type>
> #end
> Output of erroneous tabbing:
> 				<type>
>     				    				<AZ>
>                         <fiveYears>true</fiveYears>
>                         <thirtyNineMonths>false</thirtyNineMonths>
>                     </AZ>
>                                </type>
> If I remove the indentation from the #if and #end then the output is normal. Having to remove the indentation is undesirable as it makes the template difficult to read.
> Template with removed indentation for #if and #end:
> #foreach($order in $orderList)
> 		<type>
> #if("$order.type" == "AZ")
>     			<AZ>
>                             <fiveYears>$order.typeVar1</fiveYears>
>                             <thirtyNineMonths>$order.typeVar2</thirtyNineMonths>
>                         </AZ>
> #end
>                </type>
> #end
> Output with indentation for #if and #end removed;
> 		            <type>
>     		                <AZ>
>                         <fiveYears>true</fiveYears>
>                         <thirtyNineMonths>false</thirtyNineMonths>
>                     </AZ>
>                 </type>

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
For additional commands, e-mail: dev-help@velocity.apache.org


[jira] Updated: (VELOCITY-792) Template if statement throws off tabbing

Posted by "Kevin Swanson (JIRA)" <de...@velocity.apache.org>.
     [ https://issues.apache.org/jira/browse/VELOCITY-792?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Kevin Swanson updated VELOCITY-792:
-----------------------------------

    Description: 
When using a velocity template for XML output. I encounter tabbing issues when using an IF statement. Below you can find an example of what is happening:

Template which produces erroneous tabbing:

#foreach($order in $orderList)
		<type>
    			#if("$order.type" == "AZ")
    			<AZ>
                            <fiveYears>$order.typeVar1</fiveYears>
                            <thirtyNineMonths>$order.typeVar2</thirtyNineMonths>
                        </AZ>
                        #end
               </type>
#end

Output of erroneous tabbing:
				<type>
    				    				<AZ>
                        <fiveYears>true</fiveYears>
                        <thirtyNineMonths>false</thirtyNineMonths>
                    </AZ>
                               </type>

If I remove the indentation from the #if and #end then the output is normal. Having to remove the indentation is undesirable as it makes the template difficult to read.

Template with removed indentation for #if and #end:

#foreach($order in $orderList)
		<type>
#if("$order.type" == "AZ")
    			<AZ>
                            <fiveYears>$order.typeVar1</fiveYears>
                            <thirtyNineMonths>$order.typeVar2</thirtyNineMonths>
                        </AZ>
#end
               </type>
#end

Output with indentation for #if and #end removed;
                <type>
                    <AZ>
                        <fiveYears>true</fiveYears>
                        <thirtyNineMonths>false</thirtyNineMonths>
                    </AZ>
                </type>

  was:
When using a velocity template for XML output. I encounter tabbing issues when using an IF statement. Below you can find an example of what is happening:

Template which produces erroneous tabbing:

#foreach($order in $orderList)
		<type>
    			#if("$order.type" == "AZ")
    			<AZ>
                            <fiveYears>$order.typeVar1</fiveYears>
                            <thirtyNineMonths>$order.typeVar2</thirtyNineMonths>
                        </AZ>
                        #end
               </type>
#end

Output of erroneous tabbing:
				<type>
    				    				<AZ>
                        <fiveYears>true</fiveYears>
                        <thirtyNineMonths>false</thirtyNineMonths>
                    </AZ>
                               </type>

If I remove the indentation from the #if and #end then the output is normal. Having to remove the indentation is undesirable as it makes the template difficult to read.

Template with removed indentation for #if and #end:

#foreach($order in $orderList)
		<type>
#if("$order.type" == "AZ")
    			<AZ>
                            <fiveYears>$order.typeVar1</fiveYears>
                            <thirtyNineMonths>$order.typeVar2</thirtyNineMonths>
                        </AZ>
#end
               </type>
#end

Output with indentation for #if and #end removed;
		            <type>
    		                <AZ>
                        <fiveYears>true</fiveYears>
                        <thirtyNineMonths>false</thirtyNineMonths>
                    </AZ>
                </type>


> Template if statement throws off tabbing
> ----------------------------------------
>
>                 Key: VELOCITY-792
>                 URL: https://issues.apache.org/jira/browse/VELOCITY-792
>             Project: Velocity
>          Issue Type: Bug
>         Environment: Eclipse IDE. 
> Microsoft XP.
>            Reporter: Kevin Swanson
>
> When using a velocity template for XML output. I encounter tabbing issues when using an IF statement. Below you can find an example of what is happening:
> Template which produces erroneous tabbing:
> #foreach($order in $orderList)
> 		<type>
>     			#if("$order.type" == "AZ")
>     			<AZ>
>                             <fiveYears>$order.typeVar1</fiveYears>
>                             <thirtyNineMonths>$order.typeVar2</thirtyNineMonths>
>                         </AZ>
>                         #end
>                </type>
> #end
> Output of erroneous tabbing:
> 				<type>
>     				    				<AZ>
>                         <fiveYears>true</fiveYears>
>                         <thirtyNineMonths>false</thirtyNineMonths>
>                     </AZ>
>                                </type>
> If I remove the indentation from the #if and #end then the output is normal. Having to remove the indentation is undesirable as it makes the template difficult to read.
> Template with removed indentation for #if and #end:
> #foreach($order in $orderList)
> 		<type>
> #if("$order.type" == "AZ")
>     			<AZ>
>                             <fiveYears>$order.typeVar1</fiveYears>
>                             <thirtyNineMonths>$order.typeVar2</thirtyNineMonths>
>                         </AZ>
> #end
>                </type>
> #end
> Output with indentation for #if and #end removed;
>                 <type>
>                     <AZ>
>                         <fiveYears>true</fiveYears>
>                         <thirtyNineMonths>false</thirtyNineMonths>
>                     </AZ>
>                 </type>

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
For additional commands, e-mail: dev-help@velocity.apache.org


[jira] Updated: (VELOCITY-792) Template if statement throws off tabbing

Posted by "Kevin Swanson (JIRA)" <de...@velocity.apache.org>.
     [ https://issues.apache.org/jira/browse/VELOCITY-792?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Kevin Swanson updated VELOCITY-792:
-----------------------------------

    Description: 
When using a velocity template for XML output. I encounter tabbing issues when using an IF statement. Below you can find an example of what is happening:

Template which produces erroneous tabbing:

#foreach($order in $orderList)
		<type>
    			#if("$order.type" == "AZ")
    			<AZ>
                            <fiveYears>$order.typeVar1</fiveYears>
                            <thirtyNineMonths>$order.typeVar2</thirtyNineMonths>
                        </AZ>
                        #end
               </type>
#end

Output of erroneous tabbing:
				<type>
    				    				<AZ>
                        <fiveYears>true</fiveYears>
                        <thirtyNineMonths>false</thirtyNineMonths>
                    </AZ>
                               </type>

If I remove the indentation from the #if and #end then the output is normal. Having to remove the indentation is undesirable as it makes the template difficult to read.

Template with removed indentation for #if and #end:

#foreach($order in $orderList)
		<type>
#if("$order.type" == "AZ")
    			<AZ>
                            <fiveYears>$order.typeVar1</fiveYears>
                            <thirtyNineMonths>$order.typeVar2</thirtyNineMonths>
                        </AZ>
#end
               </type>
#end

Output with indentation for #if and #end removed;
		    <type>
    		        <AZ>
                        <fiveYears>true</fiveYears>
                        <thirtyNineMonths>false</thirtyNineMonths>
                    </AZ>
                </type>

  was:
When using a velocity template for XML output. I encounter tabbing issues when using an IF statement. Below you can find an example of what is happening:

Template which produces erroneous tabbing:

#foreach($order in $orderList)
		<type>
    			#if("$order.type" == "AZ")
    			<AZ>
                            <fiveYears>$order.typeVar1</fiveYears>
                            <thirtyNineMonths>$order.typeVar2</thirtyNineMonths>
                        </AZ>
                        #end
               </type>
#end

Output of erroneous tabbing:
				<type>
    				    				<AZ>
                        <fiveYears>true</fiveYears>
                        <thirtyNineMonths>false</thirtyNineMonths>
                    </AZ>
                               </type>

If I remove the indentation from the #if and #end then the output is normal. Having to remove the indentation is undesirable as it makes the template difficult to read.

Template with removed indentation for #if and #end:

#foreach($order in $orderList)
		<type>
#if("$order.type" == "AZ")
    			<AZ>
                            <fiveYears>$order.typeVar1</fiveYears>
                            <thirtyNineMonths>$order.typeVar2</thirtyNineMonths>
                        </AZ>
#end
               </type>
#end

Output with indentation for #if and #end removed;
		<type>
    		    <AZ>
                        <fiveYears>true</fiveYears>
                        <thirtyNineMonths>false</thirtyNineMonths>
                    </AZ>
                </type>


> Template if statement throws off tabbing
> ----------------------------------------
>
>                 Key: VELOCITY-792
>                 URL: https://issues.apache.org/jira/browse/VELOCITY-792
>             Project: Velocity
>          Issue Type: Bug
>         Environment: Eclipse IDE. 
> Microsoft XP.
>            Reporter: Kevin Swanson
>
> When using a velocity template for XML output. I encounter tabbing issues when using an IF statement. Below you can find an example of what is happening:
> Template which produces erroneous tabbing:
> #foreach($order in $orderList)
> 		<type>
>     			#if("$order.type" == "AZ")
>     			<AZ>
>                             <fiveYears>$order.typeVar1</fiveYears>
>                             <thirtyNineMonths>$order.typeVar2</thirtyNineMonths>
>                         </AZ>
>                         #end
>                </type>
> #end
> Output of erroneous tabbing:
> 				<type>
>     				    				<AZ>
>                         <fiveYears>true</fiveYears>
>                         <thirtyNineMonths>false</thirtyNineMonths>
>                     </AZ>
>                                </type>
> If I remove the indentation from the #if and #end then the output is normal. Having to remove the indentation is undesirable as it makes the template difficult to read.
> Template with removed indentation for #if and #end:
> #foreach($order in $orderList)
> 		<type>
> #if("$order.type" == "AZ")
>     			<AZ>
>                             <fiveYears>$order.typeVar1</fiveYears>
>                             <thirtyNineMonths>$order.typeVar2</thirtyNineMonths>
>                         </AZ>
> #end
>                </type>
> #end
> Output with indentation for #if and #end removed;
> 		    <type>
>     		        <AZ>
>                         <fiveYears>true</fiveYears>
>                         <thirtyNineMonths>false</thirtyNineMonths>
>                     </AZ>
>                 </type>

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
For additional commands, e-mail: dev-help@velocity.apache.org


[jira] Updated: (VELOCITY-792) Template if statement throws off tabbing

Posted by "Nathan Bubna (JIRA)" <de...@velocity.apache.org>.
     [ https://issues.apache.org/jira/browse/VELOCITY-792?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Nathan Bubna updated VELOCITY-792:
----------------------------------

    Affects Version/s: 2.x
        Fix Version/s: 2.x
           Issue Type: Improvement  (was: Bug)

Whitespace handling is an ancient debate, left unsettled in the past due to inability to agree on anything, left unsettled in the present by lack of anyone stepping up to implement a solution.   Nobody seems to care enough to prioritize it anymore.  You can join the ranks of the opinionated-but-insufficiently-motived people by "voting" here:

http://wiki.apache.org/velocity/VelocityWhitespaceGobbling

> Template if statement throws off tabbing
> ----------------------------------------
>
>                 Key: VELOCITY-792
>                 URL: https://issues.apache.org/jira/browse/VELOCITY-792
>             Project: Velocity
>          Issue Type: Improvement
>    Affects Versions: 2.x
>         Environment: Eclipse IDE. 
> Microsoft XP.
>            Reporter: Kevin Swanson
>             Fix For: 2.x
>
>
> When using a velocity template for XML output. I encounter tabbing issues when using an IF statement. Below you can find an example of what is happening:
> Template which produces erroneous tabbing:
> #foreach($order in $orderList)
> 		<type>
>     			#if("$order.type" == "AZ")
>     			<AZ>
>                             <fiveYears>$order.typeVar1</fiveYears>
>                             <thirtyNineMonths>$order.typeVar2</thirtyNineMonths>
>                         </AZ>
>                         #end
>                </type>
> #end
> Output of erroneous tabbing:
> 				<type>
>     				    				<AZ>
>                         <fiveYears>true</fiveYears>
>                         <thirtyNineMonths>false</thirtyNineMonths>
>                     </AZ>
>                                </type>
> If I remove the indentation from the #if and #end then the output is normal. Having to remove the indentation is undesirable as it makes the template difficult to read.
> Template with removed indentation for #if and #end:
> #foreach($order in $orderList)
> 		<type>
> #if("$order.type" == "AZ")
>     			<AZ>
>                             <fiveYears>$order.typeVar1</fiveYears>
>                             <thirtyNineMonths>$order.typeVar2</thirtyNineMonths>
>                         </AZ>
> #end
>                </type>
> #end
> Output with indentation for #if and #end removed;
>                 <type>
>                     <AZ>
>                         <fiveYears>true</fiveYears>
>                         <thirtyNineMonths>false</thirtyNineMonths>
>                     </AZ>
>                 </type>

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
For additional commands, e-mail: dev-help@velocity.apache.org


[jira] Updated: (VELOCITY-792) Template if statement throws off tabbing

Posted by "Kevin Swanson (JIRA)" <de...@velocity.apache.org>.
     [ https://issues.apache.org/jira/browse/VELOCITY-792?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Kevin Swanson updated VELOCITY-792:
-----------------------------------

    Description: 
When using a velocity template for XML output. I encounter tabbing issues when using an IF statement. Below you can find an example of what is happening:

Template which produces erroneous tabbing:

#foreach($order in $orderList)
		<type>
    			#if("$order.type" == "AZ")
    			<AZ>
                            <fiveYears>$order.typeVar1</fiveYears>
                            <thirtyNineMonths>$order.typeVar2</thirtyNineMonths>
                        </AZ>
                        #end
               </type>
#end

Output of erroneous tabbing:
				<type>
    				    				<AZ>
                        <fiveYears>true</fiveYears>
                        <thirtyNineMonths>false</thirtyNineMonths>
                    </AZ>
                               </type>

If I remove the indentation from the #if and #end then the output is normal. Having to remove the indentation is undesirable as it makes the template difficult to read.

Template with removed indentation for #if and #end:

#foreach($order in $orderList)
		<type>
#if("$order.type" == "AZ")
    			<AZ>
                            <fiveYears>$order.typeVar1</fiveYears>
                            <thirtyNineMonths>$order.typeVar2</thirtyNineMonths>
                        </AZ>
#end
               </type>
#end

Output with indentation for #if and #end removed;
				<type>
    				<AZ>
                        <fiveYears>true</fiveYears>
                        <thirtyNineMonths>false</thirtyNineMonths>
                    </AZ>
                </type>

  was:
When using a velocity template for XML output. I encounter tabbing issues when using an IF statement. Below you can find an example of what is happening:

Template which produces erroneous tabbing:

#foreach($order in $orderList)
		<type>
    			#if("$order.type" == "AZ")
    			<AZ>
                            <fiveYears>$order.typeVar1</fiveYears>
                            <thirtyNineMonths>$order.typeVar2</thirtyNineMonths>
                        </AZ>
                        #end
               </type>
#end

Output of erroneous tabbing:
				<type>
    				    				<AZ>
                        <fiveYears>true</fiveYears>
                        <thirtyNineMonths>false</thirtyNineMonths>
                    </AZ>
                               </type>

If I remove the indentation from the #if and #end then the output is normal. Having to remove the indentation is undesirable as it makes the template difficult to read.

Template with removed indentation for #if and #end:

#foreach($order in $orderList)
		<type>
#if("$order.type" == "AZ")
    			<AZ>
                            <fiveYears>$order.typeVar1</fiveYears>
                            <thirtyNineMonths>$order.typeVar2</thirtyNineMonths>
                        </AZ>
#end
               </type>
#end

Output with indentation for #if and #end removed;
		<type>
    		    <AZ>
                        <fiveYears>true</fiveYears>
                        <thirtyNineMonths>false</thirtyNineMonths>
                    </AZ>
                </type>


> Template if statement throws off tabbing
> ----------------------------------------
>
>                 Key: VELOCITY-792
>                 URL: https://issues.apache.org/jira/browse/VELOCITY-792
>             Project: Velocity
>          Issue Type: Bug
>         Environment: Eclipse IDE. 
> Microsoft XP.
>            Reporter: Kevin Swanson
>
> When using a velocity template for XML output. I encounter tabbing issues when using an IF statement. Below you can find an example of what is happening:
> Template which produces erroneous tabbing:
> #foreach($order in $orderList)
> 		<type>
>     			#if("$order.type" == "AZ")
>     			<AZ>
>                             <fiveYears>$order.typeVar1</fiveYears>
>                             <thirtyNineMonths>$order.typeVar2</thirtyNineMonths>
>                         </AZ>
>                         #end
>                </type>
> #end
> Output of erroneous tabbing:
> 				<type>
>     				    				<AZ>
>                         <fiveYears>true</fiveYears>
>                         <thirtyNineMonths>false</thirtyNineMonths>
>                     </AZ>
>                                </type>
> If I remove the indentation from the #if and #end then the output is normal. Having to remove the indentation is undesirable as it makes the template difficult to read.
> Template with removed indentation for #if and #end:
> #foreach($order in $orderList)
> 		<type>
> #if("$order.type" == "AZ")
>     			<AZ>
>                             <fiveYears>$order.typeVar1</fiveYears>
>                             <thirtyNineMonths>$order.typeVar2</thirtyNineMonths>
>                         </AZ>
> #end
>                </type>
> #end
> Output with indentation for #if and #end removed;
> 				<type>
>     				<AZ>
>                         <fiveYears>true</fiveYears>
>                         <thirtyNineMonths>false</thirtyNineMonths>
>                     </AZ>
>                 </type>

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
For additional commands, e-mail: dev-help@velocity.apache.org


[jira] Commented: (VELOCITY-792) Template if statement throws off tabbing

Posted by "Sergiu Dumitriu (JIRA)" <de...@velocity.apache.org>.
    [ https://issues.apache.org/jira/browse/VELOCITY-792?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12977061#action_12977061 ] 

Sergiu Dumitriu commented on VELOCITY-792:
------------------------------------------

I don't think this should be fixed globally. In some output types whitespace is critical (think Python).

What we did inside XWiki was to write a filtering pre-processor which compacts whitespace in the velocity code according to different rules. See http://extensions.xwiki.org/xwiki/bin/view/Extension/Velocity+Macro+Filter for more details.

> Template if statement throws off tabbing
> ----------------------------------------
>
>                 Key: VELOCITY-792
>                 URL: https://issues.apache.org/jira/browse/VELOCITY-792
>             Project: Velocity
>          Issue Type: Bug
>         Environment: Eclipse IDE. 
> Microsoft XP.
>            Reporter: Kevin Swanson
>
> When using a velocity template for XML output. I encounter tabbing issues when using an IF statement. Below you can find an example of what is happening:
> Template which produces erroneous tabbing:
> #foreach($order in $orderList)
> 		<type>
>     			#if("$order.type" == "AZ")
>     			<AZ>
>                             <fiveYears>$order.typeVar1</fiveYears>
>                             <thirtyNineMonths>$order.typeVar2</thirtyNineMonths>
>                         </AZ>
>                         #end
>                </type>
> #end
> Output of erroneous tabbing:
> 				<type>
>     				    				<AZ>
>                         <fiveYears>true</fiveYears>
>                         <thirtyNineMonths>false</thirtyNineMonths>
>                     </AZ>
>                                </type>
> If I remove the indentation from the #if and #end then the output is normal. Having to remove the indentation is undesirable as it makes the template difficult to read.
> Template with removed indentation for #if and #end:
> #foreach($order in $orderList)
> 		<type>
> #if("$order.type" == "AZ")
>     			<AZ>
>                             <fiveYears>$order.typeVar1</fiveYears>
>                             <thirtyNineMonths>$order.typeVar2</thirtyNineMonths>
>                         </AZ>
> #end
>                </type>
> #end
> Output with indentation for #if and #end removed;
>                 <type>
>                     <AZ>
>                         <fiveYears>true</fiveYears>
>                         <thirtyNineMonths>false</thirtyNineMonths>
>                     </AZ>
>                 </type>

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
For additional commands, e-mail: dev-help@velocity.apache.org