Hi,

 

I am currently updating to the CVS version of Cocoon and found out that my suggestion-lists no longer worked. I did a normal build of cocoon and tried out the sample for suggestion-lists and that didn’t work either. I compared the output of the suggestion-list pipeline to the sample files shipped in the dojo test folder and saw that they don’t have a trailing “;”. After removing this, the samples and my version worked again without any problems. Maybe it would be good to update the selection-list2json.xsl or to update the Suggestion-List CForms widget code if this would result in breaking other parts.

 

Here my updated file:

 

<?xml version="1.0"?>

<!--

  Licensed to the Apache Software Foundation (ASF) under one or more

  contributor license agreements.  See the NOTICE file distributed with

  this work for additional information regarding copyright ownership.

  The ASF licenses this file to You under the Apache License, Version 2.0

  (the "License"); you may not use this file except in compliance with

  the License.  You may obtain a copy of the License at

 

      http://www.apache.org/licenses/LICENSE-2.0

 

  Unless required by applicable law or agreed to in writing, software

  distributed under the License is distributed on an "AS IS" BASIS,

  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

  See the License for the specific language governing permissions and

  limitations under the License.

-->

<!--

  Transforms a fi:selection-list into a JSON fragment.

 

  @version $Id: selection-list2json.xsl 449149 2006-09-23 03:58:05Z crossley $

-->

 

<xsl:stylesheet

  version="1.0"

  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"

  xmlns:fi="http://apache.org/cocoon/forms/1.0#instance">

 

<xsl:template match="fi:selection-list">

  <dummy-root>

    <xsl:text>[&#10;</xsl:text>

    <xsl:apply-templates/>

    <xsl:text>&#10;]</xsl:text>

  </dummy-root>

</xsl:template>

 

<xsl:template match="fi:item">

  <xsl:text>["</xsl:text>

  <!-- displayed text -->

  <xsl:choose>

    <xsl:when test="fi:label">

      <xsl:value-of select="fi:label"/>

    </xsl:when>

    <xsl:otherwise>

      <xsl:value-of select="@value"/>

    </xsl:otherwise>

  </xsl:choose>

  <xsl:text>", "</xsl:text>

  <!-- value -->

  <xsl:value-of select="@value"/>

  <xsl:text>"]</xsl:text>

  <xsl:if test="position() != last()">

    <xsl:text>, &#10;</xsl:text>

  </xsl:if>

</xsl:template>

 

</xsl:stylesheet>

 

Regards,

     Chris

 

[ c h r i s t o f e r   d u t z ]

 

IT-Berater

univativ GmbH & Co. KG

Robert-Bosch-Str. 7, 64293 Darmstadt

 

fon: 0 61 51 / 66 717 - 21

fax: 0 61 51 / 66 717 - 29

email: [EMAIL PROTECTED]

http://www.univativ.de

 

Darmstadt, Stuttgart, Karlsruhe, Düsseldorf

 

Reply via email to