[prev in list] [next in list] [prev in thread] [next in thread] 

List:       velocity-user
Subject:    Re: Unable to convert the data to xml
From:       Claude Brisson <claude () renegat ! net ! INVALID>
Date:       2023-06-28 0:08:58
Message-ID: 8816c73d-5ead-00d9-3270-2be4a39138c7 () renegat ! net
[Download RAW message or body]

Oh, and : please read the Velocity Template Language syntax: you cannot 
use parenthesis or spaces like you do.

On 28/06/2023 01:58, Claude Brisson wrote:
> Please don't copy paste your templates like this, it's not useful. You 
> are getting variable names just because your context is not properly 
> populated. Without any further description of how you call Velocity, 
> it is difficult to help you.
>
>
> On 25/05/2023 14:48, narasimha gudisa wrote:
>> Hello, I have data in the excel file I would like to convert the data to
>> the xml format using the apache velocity transformation engine.
>>
>> My template  :
>>
>> <?xml version="1.0" encoding="UTF-8"?>
>> <root>
>> #foreach ($line in $data)
>> <row>
>>      <timestamp type = "string">$(line.Timestamp(optional))</timestamp>
>>   <targettype type = "string">$line.Target Type</targettype>
>> <targetname type = "string">$line.Target Name</targetname>
>> <blockingevent type = "string">$line.Blocking
>> Event(optional)</blockingevent>
>>   <message type = "string">$line.Message</message>
>>
>> </row>
>> #end
>> </root>
>>
>> Getting the output :
>>
>> <root>
>> <row>
>> <timestamp type="string">$(line.Timestamp(optional))</timestamp>
>> <targettype type="string">$line.Target Type</targettype>
>> <targetname type="string">$line.Target Name</targetname>
>> <blockingevent type="string">$line.Blocking 
>> Event(optional)</blockingevent>
>> <message type="string">$line.Message</message>
>> </row>
>> <row>
>> <timestamp type="string">$(line.Timestamp(optional))</timestamp>
>> <targettype type="string">$line.Target Type</targettype>
>> <targetname type="string">$line.Target Name</targetname>
>> <blockingevent type="string">$line.Blocking 
>> Event(optional)</blockingevent>
>> <message type="string">$line.Message</message>
>> </row>
>> <row>
>> <timestamp type="string">$(line.Timestamp(optional))</timestamp>
>> <targettype type="string">$line.Target Type</targettype>
>> <targetname type="string">$line.Target Name</targetname>
>> <blockingevent type="string">$line.Blocking 
>> Event(optional)</blockingevent>
>> <message type="string">$line.Message</message>
>> </row>
>> <row>
>> <timestamp type="string">$(line.Timestamp(optional))</timestamp>
>> <targettype type="string">$line.Target Type</targettype>
>> <targetname type="string">$line.Target Name</targetname>
>> <blockingevent type="string">$line.Blocking 
>> Event(optional)</blockingevent>
>> <message type="string">$line.Message</message>
>> </row>
>> <row>
>> <timestamp type="string">$(line.Timestamp(optional))</timestamp>
>> <targettype type="string">$line.Target Type</targettype>
>> <targetname type="string">$line.Target Name</targetname>
>> <blockingevent type="string">$line.Blocking 
>> Event(optional)</blockingevent>
>> <message type="string">$line.Message</message>
>> </row>
>> <row>
>> <timestamp type="string">$(line.Timestamp(optional))</timestamp>
>> <targettype type="string">$line.Target Type</targettype>
>> <targetname type="string">$line.Target Name</targetname>
>> <blockingevent type="string">$line.Blocking 
>> Event(optional)</blockingevent>
>> <message type="string">$line.Message</message>
>> </row>
>> <row>
>> <timestamp type="string">$(line.Timestamp(optional))</timestamp>
>> <targettype type="string">$line.Target Type</targettype>
>> <targetname type="string">$line.Target Name</targetname>
>> <blockingevent type="string">$line.Blocking 
>> Event(optional)</blockingevent>
>> <message type="string">$line.Message</message>
>> </row>
>> <row>
>> <timestamp type="string">$(line.Timestamp(optional))</timestamp>
>> <targettype type="string">$line.Target Type</targettype>
>> <targetname type="string">$line.Target Name</targetname>
>> <blockingevent type="string">$line.Blocking 
>> Event(optional)</blockingevent>
>> <message type="string">$line.Message</message>
>> </row>
>> <row>
>> <timestamp type="string">$(line.Timestamp(optional))</timestamp>
>> <targettype type="string">$line.Target Type</targettype>
>> <targetname type="string">$line.Target Name</targetname>
>> <blockingevent type="string">$line.Blocking 
>> Event(optional)</blockingevent>
>> <message type="string">$line.Message</message>
>> </row>
>> <row>
>> <timestamp type="string">$(line.Timestamp(optional))</timestamp>
>> <targettype type="string">$line.Target Type</targettype>
>> <targetname type="string">$line.Target Name</targetname>
>> <blockingevent type="string">$line.Blocking 
>> Event(optional)</blockingevent>
>> <message type="string">$line.Message</message>
>> </row>
>> </root>
>>
>> I'm getting the variable names instead of data can you help me 
>> achieve this
>>
>> Thanks in advance
>>
>> Thanks
>> Narasimha Gudisa
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
> For additional commands, e-mail: user-help@velocity.apache.org
>

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

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic