cancel
Showing results for 
Search instead for 
Did you mean: 

Web Form Output Path Error

a_band
Champ in-the-making
Champ in-the-making
I've got a web form created and it was working fine until I tried modifying the output path to use xml data from the document. I'm trying to get the output file to be generated into a directory based on a user-defined value in the web form.

Here's the output path:

/${webapp}/articles/${xml['article:article/article:title']}/${name}.xml

Here's the web form XSD:

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"

   xmlns:article="http://www.alfresco.org/alfresco/article"

   targetNamespace="http://www.alfresco.org/alfresco/article"

   elementFormDefault="qualified">



   <!– defines the form for creating a press release –>

   <xs:element name="article">

      <xs:complexType>

         <xs:sequence>

            <xs:element name="title" type="xs:normalizedString" />

            <xs:element name="author" type="xs:normalizedString" />

            <xs:element name="article_category" type="xs:normalizedString" />

            <xs:element name="teaser" type="xs:string"/>

            <xs:element name="keywords" type="xs:normalizedString" minOccurs="0" maxOccurs="unbounded" />

            <xs:element name="body" type="xs:string" minOccurs="1" maxOccurs="unbounded" />

                 <xs:element name="–" minOccurs="0"

               maxOccurs="unbounded">

               <xs:complexType>

                  <xs:sequence>

                     <xs:element name="image" type="xs:anyURI" minOccurs="0" maxOccurs="1"/>

                     <xs:element name="caption" type="xs:normalizedString" minOccurs="0" maxOccurs="1"/>

                     <xs:element name="page_number" type="xs:integer" minOccurs="0" maxOccurs="1"/>

                  </xs:sequence>

               </xs:complexType>

            </xs:element>

            <xs:element name="publish_date" type="xs:date"/>

         </xs:sequence>

      </xs:complexType>

   </xs:element>

</xs:schema>

Everything looks good but when I try to save this I get this error:

Please correct the errors below then click Finish.

* Error processing output path pattern <#ftl ns_prefixes={ "alf":"http://www.alfresco.org", "article":"http://www.alfresco.org/alfresco/article", "chiba":"http://chiba.sourceforge.net/xforms", "ev":"http://www.w3.org/2001/xml-events", "xf":"http://www.w3.org/2002/xforms", "xhtml":"http://www.w3.org/1999/xhtml", "xs":"http://www.w3.org/2001/XMLSchema", "xsi":"http://www.w3.org/2001/XMLSchema-instance"}> /${webapp}/articles/${xml['article:article/article:title']}/${name}.xml for Baking Bread in webapp ROOT: Error during processing of the template 'Error on line 10, column 23 in string://fixed Expecting a string, date or number here, Expression xml['article:article/article:title'] is instead a freemarker.ext.dom.NodeListModel'. Please contact your system administrator.
3 REPLIES 3

a_band
Champ in-the-making
Champ in-the-making
no response, eh? Do you think I should submit a JIRA ticket?

kvc
Champ in-the-making
Champ in-the-making
If you do not include your target namespace declaration in your Freemarker template, you get a similar message to this.  I see you have declared a targetNamespace of article.  Is this referenced in your Freemarker template?

If you are a customer, would recommend opening a support case.  That way one of our support engineers can help you diagnose and debug your template (I think this is a quick fix; you'll need to submit your XSD and Freemarker template with the support case).

Kevin

a_band
Champ in-the-making
Champ in-the-making
thanks, I thought I had my namespaces configured correctly but I'll double-check.