You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@velocity.apache.org by Prabhakar Krishnaswami <PK...@dynix.com> on 2004/05/18 02:35:19 UTC
VM not generating the XML
I have a simple velocity template which is not generating the XML
properly.
Template looks like this:
<?xml version="1.0" encoding="UTF-8"?>
$response.setContentType("text/xml")
<requestConfirmation>
<userName>$UrsaSessionObject.getRequestData().getRequestUser().getName()
</userName>
<locations>
#foreach ($record in $sessionObject.pickupLocations)
<location>
<id>$record.id</id>
<name>$record.name</name>
</location>
#end
</locations>
<availability>aaaa</availability>
<cost>ssss</cost>
</requestConfirmation>
When I look at the XML generated, against the username it seems just
reproduce the string as it is but in the second case the value is
derived and it is placed in the XML properly. I have checked just the
objects in question and they contain the fields I am trying to parse.
When I look at the server console, I see a message
$UrsaSessionObject.getRequestData().getRequestUser().getName() is not a
valid reference.
Can someone suggest what I am doing wrong?
Prabhakar Krishnaswami
Software Engineer
Dynix
pkrishnaswami@dynix.com
p 801-223-5817
f 801-223-5202
www.dynix.com
<file:///C:\Documents%20and%20Settings\PKrishna\Application%20Data\Micro
soft\Signatures\www.dynix.com>