freemarker.core.NonStringException

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

freemarker.core.NonStringException

Archana D Patange
Hi,
       
In the below given XML, I'm trying to fetch the "href" node to set an attribute in ImageDO element but facing,  " freemarker.core.NonStringException", exception. Can anyone please let me know whether the below code for fetching the value is correct or please guide me for fetching the value of "href".
 
XML:
 
<?xml version="1.0" encoding="UTF-8"?>
<Module>
<containers>
<Container><type>data</type>
<paras>
<p><imageDO><href>Image01.jpeg</href></imageDO></p>
<p><textDO><text>Text1...</text></textDO></p>
<p><imageDO><href>Image02.jpeg</href></imageDO></p>
<p><textDO><text>Text2</text></textDO></p>
<p><imageDO><href>Image03.jpeg</href></imageDO></p>
<p><textDO><text>Fofcr jeden Anrufer individuell !</text></textDO></p>
</paras>
</Container>
<Container><type>data</type>
<textDO><text>text4.</text></textDO>
</Container>
</containers>
</Module>
 
Code:
 
<#if doc.Module.containers??>
  <#foreach cont in doc.Module.containers>
   
    <#if !cont.Container.paras.p.imageDO.href??>
        <IMAGE HREF="${para.p.imageDO.href}"></IMAGE>
    </#if>
  </#foreach>
 </#if>
 
Thanks for reply, in advance.
Archana
This email message and its attachments may contain CONFIDENTIAL AND PRIVILEGED INFORMATION intended for the sole use of the addressee(s). If you have received it in error, please contact the sender by return email, notify your system manager and destroy the original message and any copies thereof. Any review, use, disclosure or distribution is unlawful. Please check this email and any attachments for the presence of viruses. The Company accepts no liability for any damage caused by any virus transmitted by this email. The views or opinions presented in this e-mail are solely those of the author and do not necessarily represent those of the company.
The Company reserves the right to monitor, review and store the content of all messages sent to or from this e-mail address.

www.aztecsoft.com

------------------------------------------------------------------------------
Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM)
software. With Adobe AIR, Ajax developers can use existing skills and code to
build responsive, highly engaging applications that combine the power of local
resources and data with the reach of the web. Download the Adobe AIR SDK and
Ajax docs to start building applications today-http://p.sf.net/sfu/adobe-com
_______________________________________________
FreeMarker-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/freemarker-user
Reply | Threaded
Open this post in threaded view
|

Re: freemarker.core.NonStringException

Daniel Dekany
Monday, February 9, 2009, 2:05:37 PM, Archana D Patange wrote:

> Hi,
>        
> In the below given XML, I'm trying to fetch the "href" node to set
> an attribute in ImageDO element but facing,  "
> freemarker.core.NonStringException", exception. Can anyone please
> let me know whether the below code for fetching the value is correct
> or please guide me for fetching the value of "href".
>  
> XML:
>  
> <?xml version="1.0" encoding="UTF-8"?>
> <Module>
> <containers>
> <Container><type>data</type>
> <paras>
> <p><imageDO><href>Image01.jpeg</href></imageDO></p>
> <p><textDO><text>Text1...</text></textDO></p>
> <p><imageDO><href>Image02.jpeg</href></imageDO></p>
> <p><textDO><text>Text2</text></textDO></p>
> <p><imageDO><href>Image03.jpeg</href></imageDO></p>
> <p><textDO><text>Fofcr jeden Anrufer individuell !</text></textDO></p>
> </paras>
> </Container>
> <Container><type>data</type>
> <textDO><text>text4.</text></textDO>
> </Container>
> </containers>
> </Module>
>  
> Code:
>  
> <#if doc.Module.containers??>
>   <#foreach cont in doc.Module.containers>
>        <#if !cont.Container.paras.p.imageDO.href??>
>         <IMAGE HREF="${para.p.imageDO.href}"></IMAGE>
>     </#if>
>   </#foreach>
>  </#if>

The template is incorrect for several XML-processing-related reasons.
Please read http://freemarker.org/docs/xgui_imperative_learn.html
before trying to process XML.

> Thanks for reply, in advance.
> Archana
> This email message and its attachments may contain CONFIDENTIAL AND
> PRIVILEGED INFORMATION intended for the sole use of the
> addressee(s). If you have received it in error, please contact the
> sender by return email, notify your system manager and destroy the
> original message and any copies thereof. Any review, use, disclosure
> or distribution is unlawful. Please check this email and any
> attachments for the presence of viruses. The Company accepts no
> liability for any damage caused by any virus transmitted by this
> email. The views or opinions presented in this e-mail are solely
> those of the author and do not necessarily represent those of the company.
> The Company reserves the right to monitor, review and store the
> content of all messages sent to or from this e-mail address.
>
> www.aztecsoft.com

--
Best regards,
 Daniel Dekany


------------------------------------------------------------------------------
Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM)
software. With Adobe AIR, Ajax developers can use existing skills and code to
build responsive, highly engaging applications that combine the power of local
resources and data with the reach of the web. Download the Adobe AIR SDK and
Ajax docs to start building applications today-http://p.sf.net/sfu/adobe-com
_______________________________________________
FreeMarker-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/freemarker-user