Expression simple.string is instead a freemarker.ext.dom.No
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-04-2008 09:08 AM
i m suffering from Freemarker template..
i got this error several times when i creating content in web form…
freemarker_template Expecting a string, date or number here, Expression simple.string is instead a freemarker.ext.dom.NodeListModel
i have very little knowledge about freemarker template…
plz anyone know guide me how to solve this error??
I really appreciate to your reply.
Thanks in advance
- Labels:
-
Archive

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-04-2008 11:30 AM
<#ftl ns_prefixes={"D", "http://www.alfresco.org/training"}>
It did solve the problem with Alfresco 2.1.1EDenis
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-05-2008 01:28 AM
Even i tried wht u sayed me bt still i suffering of tht prblm..
any other solution you knw for avoid this exception??

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-05-2008 06:25 AM
targetNamespace attribute of the matching xsd.
In example, here is the xsd root element of my form.
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:trn="http://www.alfresco.org/training" targetNamespace="http://www.alfresco.org/training" elementFormDefault="qualified">
Denis
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-05-2008 06:46 AM
rt nw i got another error : * Error generating rendition using LaptopFreeMarker51.ftl: Encountered "-" at line 2, column 15. Was expecting one of: "=" … "in" … ">" …
by the way i m vry confuse ..
what i want do exactly for solving this prblm..
here i give you all four files to you (xsd,xsl,xml and ftl file).
plz observe these file and tell be when i wrong..
xsd file
[<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="Laptop5Feb.xsl"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns

targetNamespace="http://www.alfresco.org/alfresco/pr"
elementFormDefault="qualified">
<xs:simpleType name="Processor">
<xs:restriction base="xs:normalizedString">
<xs:enumeration value="Pentium4"/>
<xs:enumeration value="celeron"/>
<xs:enumeration value="AMDAthlon"/>
<xs:enumeration value="DualCore"/>
</xs:restriction>
</xs:simpleType>
<xs:element name="press-release">
<xs:complexType>
<xs:sequence>
<xs:element name="CustomerName" type="xs:normalizedString"/>
<xs:element name="E-mail" type="xs:normalizedString"/>
<xs:element name="city" type="xs:normalizedString"/>
<xs:element name="CompanyName" type="xs:normalizedString"/>
<xs:element name="Processor" type="pr

<xs:element name="Ram" type="xs:normalizedString"/>
<xs:element name="ScreenSize" type="xs:normalizedString"/>
<xs:element name="HardDisk" type="xs:normalizedString"/>
<xs:element name="DVDWriter" type="xs:normalizedString"/>
<xs:element name="ExtraFeatures" type="xs:normalizedString"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
]
XSL file
[<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns

<xsl

<xsl:variable name="CustName" select="/pr

<xsl:variable name="Email" select="/pr

<xsl:variable name="city" select="/pr

<xsl:variable name="CompanyName" select="/pr

<xsl:variable name="Processor" select="/pr


<xsl:variable name="Ram" select="/pr

<xsl:variable name="ScreenSize" select="/pr


<xsl:variable name="HardDisk" select="/pr

<xsl:variable name="DVDWriter" select="/pr


<xsl:variable name="ExtraFeatures" select="/pr

<xsl:template match="/pr

<B><xsl:text>Customer Name :</xsl:text></B>
<xsl:value-of select="$CustName"/><br/>
<B><xsl:text>E-mail :</xsl:text></B>
<xsl:value-of select="$Email"/><br/>
<B><xsl:text>City :</xsl:text></B>
<xsl:value-of select="$city"/><br/>
<B><xsl:text>Company Name :</xsl:text></B>
<xsl:value-of select="$CompanyName"/><br/>
<B><xsl:text>Processor :</xsl:text></B>
<xsl:value-of select="$Processor"/><br/>
<B><xsl:text>Ram :</xsl:text></B>
<xsl:value-of select="$Ram"/><br/>
<B><xsl:text>Screen Size :</xsl:text></B>
<xsl:value-of select="$ScreenSize"/><br/>
<B><xsl:text>HardDisk :</xsl:text></B>
<xsl:value-of select="$HardDisk"/><br/>
<B><xsl:text>DVD Writer(Yes/No) :</xsl:text></B>
<xsl:value-of select="$DVDWriter"/><br/>
<B><xsl:text>Extra Features :</xsl:text></B>
<xsl:value-of select="$ExtraFeatures"/><br/>
</xsl:template>
</xsl:stylesheet>]
XML File
[<alfresco

<alfresco:CustomerName></alfresco:CustomerName>
<alfresco:E-mail></alfresco:E-mail>
<alfresco:city></alfresco:city>
<alfresco:CompanyName></alfresco:CompanyName>
<alfresco


<alfresco:Ram></alfresco:Ram>
<alfresco


<alfresco:HardDisk></alfresco:HardDisk>
<alfresco


<alfresco:ExtraFeatures></alfresco:ExtraFeatures>
</alfresco

FTL File
[<#ftl ns_prefixes={"si":"http://www.alfresco.org/alfresco/press-release"}>
<#assign press-release = .vars["si

<html>
<body>
${press-release["si:CustomerName"]}
${press-release["si:E-mail"]}
${press-release["si:city"]}
${press-release["si:CompanyName"]}
${press-release["si

${press-release["si:Ram"]}
${press-release["si

${press-release["si:HardDisk"]}
${press-release["si

${press-release["si:ExtraFeatures"]}
</body>
</html>
]

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-05-2008 04:22 PM
The current error seems to tell that the '-' character is not valid in a freemarker variable name.
Try rename 'press-release' variable into something like 'pressRelease'.
Denis
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-06-2008 01:04 AM
i made changes as per you sayed bt stil i got this error at time when we submitting content in web form:-
Error generating rendition using LaptopFreeMarker6.ftl: freemarker.core.NonStringException: Error on line 5, column 6 in freemarker_template Expecting a string, date or number here, Expression pressrelease["si:CustomerName"] is instead a freemarker.ext.dom.NodeListModel
here i again give my FTL file to you for ur observation..
plz guide me hw to resolve this critical issue …
it's vry urgent for me…
LaptopFreeMarker6.ftl
<#ftl ns_prefixes={"si":"http://www.alfresco.org/alfresco/pressrelease"}><#assign pressrelease = .vars["si:pressrelease"]> <html> <body> ${pressrelease["si:CustomerName"]} ${pressrelease["si:E-mail"]} ${pressrelease["si:city"]} ${pressrelease["si:CompanyName"]} ${pressrelease["si:Processor"]} ${pressrelease["si:Ram"]} ${pressrelease["si:ScreenSize"]} ${pressrelease["si:HardDisk"]} ${pressrelease["si:DVDWriter"]} ${pressrelease["si:ExtraFeatures"]} </body> </html>
I really appreciate for your reply..
thanks…

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-06-2008 03:39 AM
The FTL should start with
<#ftl ns_prefixes={"D":"http://www.alfresco.org/alfresco/pr"}>
where the "D" stands for Freemarker Default namespace I think, and should not be changed.The second part (the namespace) should then match the targetNamespace of your XSD, which seems to be "http://www.alfresco.org/alfresco/pr" in your case.
Denis
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-06-2008 04:12 AM
first of all thanks to you for continue to support me for solving this prblm..
after tht i again made changes in names pace:-
still i got this error:-
Error generating rendition using Freemarker62feb.ftl: freemarker.core.NonStringException: Error on line 4, column 6 in freemarker_template Expecting a string, date or number here, Expression CustomerName.string is instead a freemarker.ext.dom.NodeListModel
updated new files are as follows:-
ftl file
<#ftl ns_prefixes={"D":"http://www.alfresco.org/alfresco/pressrelease"}> <html> <body> ${CustomerName.string} ${E-mail.string} ${city.string} ${CompanyName.string} ${Processor.string} ${Ram.string} ${ScreenSize.string} ${HardDisk.string} ${DVDWriter.string} ${ExtraFeatures.string} </body> </html>
xsd file
<?xml version="1.0"?><?xml-stylesheet type="text/xsl" href="Laptop6Feb.xsl"?><xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:pr="http://www.alfresco.org/alfresco/pr" targetNamespace="http://www.alfresco.org/alfresco/pr" elementFormDefault="qualified"> <xs:simpleType name="Processor"> <xs:restriction base="xs:normalizedString"> <xs:enumeration value="Pentium4"/> <xs:enumeration value="celeron"/> <xs:enumeration value="AMDAthlon"/> <xs:enumeration value="DualCore"/> </xs:restriction> </xs:simpleType> <xs:element name="pressrelease"> <xs:complexType> <xs:sequence> <xs:element name="CustomerName" type="xs:normalizedString"/> <xs:element name="E-mail" type="xs:normalizedString"/> <xs:element name="city" type="xs:normalizedString"/> <xs:element name="CompanyName" type="xs:normalizedString"/> <xs:element name="Processor" type="pr:Processor"/> <xs:element name="Ram" type="xs:normalizedString"/> <xs:element name="ScreenSize" type="xs:normalizedString"/> <xs:element name="HardDisk" type="xs:normalizedString"/> <xs:element name="DVDWriter" type="xs:normalizedString"/> <xs:element name="ExtraFeatures" type="xs:normalizedString"/> </xs:sequence> </xs:complexType> </xs:element></xs:schema>
thanks..

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-06-2008 05:00 AM
<#ftl ns_prefixes={"D":"http://www.alfresco.org/alfresco/pr"}> <html> <body> ${pressrelease.CustomerName} ${pressrelease.E-mail} …
Denis
