You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@velocity.apache.org by Syed Mudassir Ahmed <sy...@gaianconsultants.com> on 2018/06/28 10:03:00 UTC

How to Ignore Directives

Hi Guys,
  Suppose I have a velocity template as follows:

  <?xml version="1.0" encoding="UTF-8"?> <SOAP-ENV:Envelope xmlns:SOAP-ENV="
http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Header /> <
SOAP-ENV:Body> <ns0:McK_OutputAMP xmlns:ns0="
http://www.tibco.com/schemas/Glowpoint_WebPortal_V1/Local Schema/Schema.xsd"
> #foreach($Record in $McK_OutputAMP) <ns0:Record> <ns0:FMNO>
$McK_OutputAMP.Record.FMNO</ns0:FMNO> <ns0:Last_Name>
$McK_OutputAMP.Record.LAST_NAME</ns0:Last_Name> <ns0:First_Name>
$McK_OutputAMP.Record.FIRST_NAME</ns0:First_Name> <ns0:Title>
$McK_OutputAMP.Record.TITLE</ns0:Title> <ns0:Office_Phone>
$McK_OutputAMP.Record.OFFICE_PHONE</ns0:Office_Phone> <ns0:Mobile_Phone>
$McK_OutputAMP.Record.MOBILE_PHONE</ns0:Mobile_Phone> <ns0:fax_number>
$McK_OutputAMP.Record.FAX_STRING</ns0:fax_number> <ns0:voip_number>
$McK_OutputAMP.Record.VOIP_NUMBER</ns0:voip_number> <
ns0:Internet_Email_Address>$McK_OutputAMP.Record.INTERNET_MAIL_ADDRESS</
ns0:Internet_Email_Address> <ns0:Location_Office_code>
$McK_OutputAMP.Record.LOCATION_OFFICE_CODE</ns0:Location_Office_code> <
ns0:group_string>$McK_OutputAMP.Record.GROUP_STRING</ns0:group_string> <
ns0:city>$McK_OutputAMP.Record.CITY</ns0:city> <ns0:LOTUS_NOTES_MAIL_ADDRESS
>$McK_OutputAMP.Record.LOTUS_NOTES_MAIL_ADDRESS</
ns0:LOTUS_NOTES_MAIL_ADDRESS> <ns0:SECRETARY_FMNO>
$McK_OutputAMP.Record.SECRETARY_FMNO</ns0:SECRETARY_FMNO> <
ns0:SECRETARY_NAME>$McK_OutputAMP.Record.SECRETARY_NAME</ns0:SECRETARY_NAME>
<ns0:STATUS>$McK_OutputAMP.Record.STATUS</ns0:STATUS> <ns0:Access_To_Portal>
$McK_OutputAMP.Record.ACCESS_TO_PORTAL</ns0:Access_To_Portal> <
ns0:custom_string1>$McK_OutputAMP.Record.CUSTOM_STRING1</ns0:custom_string1>
<ns0:custom_string2>$McK_OutputAMP.Record.CUSTOM_STRING2</ns0:custom_string2
> <ns0:custom_string3>$McK_OutputAMP.Record.CUSTOM_STRING3</
ns0:custom_string3> </ns0:Record> #end </ns0:McK_OutputAMP> </SOAP-ENV:Body>
</SOAP-ENV:Envelope>



While evaluating this template I want to ignore the directives.  What is
the setting to tell the engine/runtime instance to ignore the directives.

Re: How to Ignore Directives

Posted by Claude Brisson <cl...@renegat.net.INVALID>.
There seems to be at least three ways of "ignoring" a directive:

Given the template:

#foreach($foo in $list) schmoo $foo #end

it can give:

1. an empty string, as if $list is empty
2. "schmoo $foo", as if $list is { null }
3. "#foreach($foo in $list) schmoo $foo #end", as if $foo and $list are 
null and there is no #foreach directive
4. something else?


On 06/28/2018 12:03 PM, Syed Mudassir Ahmed wrote:
> Hi Guys,
>    Suppose I have a velocity template as follows:
>
>    <?xml version="1.0" encoding="UTF-8"?> <SOAP-ENV:Envelope xmlns:SOAP-ENV="
> http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Header /> <
> SOAP-ENV:Body> <ns0:McK_OutputAMP xmlns:ns0="
> http://www.tibco.com/schemas/Glowpoint_WebPortal_V1/Local Schema/Schema.xsd"
>> #foreach($Record in $McK_OutputAMP) <ns0:Record> <ns0:FMNO>
> $McK_OutputAMP.Record.FMNO</ns0:FMNO> <ns0:Last_Name>
> $McK_OutputAMP.Record.LAST_NAME</ns0:Last_Name> <ns0:First_Name>
> $McK_OutputAMP.Record.FIRST_NAME</ns0:First_Name> <ns0:Title>
> $McK_OutputAMP.Record.TITLE</ns0:Title> <ns0:Office_Phone>
> $McK_OutputAMP.Record.OFFICE_PHONE</ns0:Office_Phone> <ns0:Mobile_Phone>
> $McK_OutputAMP.Record.MOBILE_PHONE</ns0:Mobile_Phone> <ns0:fax_number>
> $McK_OutputAMP.Record.FAX_STRING</ns0:fax_number> <ns0:voip_number>
> $McK_OutputAMP.Record.VOIP_NUMBER</ns0:voip_number> <
> ns0:Internet_Email_Address>$McK_OutputAMP.Record.INTERNET_MAIL_ADDRESS</
> ns0:Internet_Email_Address> <ns0:Location_Office_code>
> $McK_OutputAMP.Record.LOCATION_OFFICE_CODE</ns0:Location_Office_code> <
> ns0:group_string>$McK_OutputAMP.Record.GROUP_STRING</ns0:group_string> <
> ns0:city>$McK_OutputAMP.Record.CITY</ns0:city> <ns0:LOTUS_NOTES_MAIL_ADDRESS
>> $McK_OutputAMP.Record.LOTUS_NOTES_MAIL_ADDRESS</
> ns0:LOTUS_NOTES_MAIL_ADDRESS> <ns0:SECRETARY_FMNO>
> $McK_OutputAMP.Record.SECRETARY_FMNO</ns0:SECRETARY_FMNO> <
> ns0:SECRETARY_NAME>$McK_OutputAMP.Record.SECRETARY_NAME</ns0:SECRETARY_NAME>
> <ns0:STATUS>$McK_OutputAMP.Record.STATUS</ns0:STATUS> <ns0:Access_To_Portal>
> $McK_OutputAMP.Record.ACCESS_TO_PORTAL</ns0:Access_To_Portal> <
> ns0:custom_string1>$McK_OutputAMP.Record.CUSTOM_STRING1</ns0:custom_string1>
> <ns0:custom_string2>$McK_OutputAMP.Record.CUSTOM_STRING2</ns0:custom_string2
>> <ns0:custom_string3>$McK_OutputAMP.Record.CUSTOM_STRING3</
> ns0:custom_string3> </ns0:Record> #end </ns0:McK_OutputAMP> </SOAP-ENV:Body>
> </SOAP-ENV:Envelope>
>
>
>
> While evaluating this template I want to ignore the directives.  What is
> the setting to tell the engine/runtime instance to ignore the directives.
>


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