repeat bug

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

repeat bug

hcr
Hi.
   I find a bug with xforms:repeat. There is My code:
<html xmlns:xs="http://www.w3.org/2001/XMLSchema"
      xmlns:xforms="http://www.w3.org/2002/xforms"
      xmlns:ev="http://www.w3.org/2001/xml-events"
      xmlns:xxforms="http://orbeon.org/oxf/xml/xforms"
      xmlns:xi="http://www.w3.org/2001/XInclude"
      xmlns:f="http://orbeon.org/oxf/xml/formatting"
      xmlns:xhtml="http://www.w3.org/1999/xhtml"
      xmlns:dmv="http://orbeon.org/oxf/examples/dmv"
      xmlns:xxi="http://orbeon.org/oxf/xml/xinclude"
      xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
      xmlns="http://www.w3.org/1999/xhtml"
   xmlns:fn="http://www.w3.org/2005/02/xpath-functions"
      xsl:version="2.0">
    <head>
        <title>Error List</title>
  <xforms:model id="main-model"> 
   <xforms:instance id="items">
    <form xmlns="">
     <items>
      <item>
       <id>0</id>
      </item>
      <item>
       <id>1</id>
      </item>
      <item>
       <id>2</id>
      </item>
     </items> 
    </form>  
   </xforms:instance> 
            <xforms:instance id="errors-instance">
                <errors xmlns="">
     <items>
      <item id="0">
      </item> 
      <item id="1">
       <error id="error-1" indexes="1" label="error-1" alert="error-1"/>
      </item> 
      <item id="2">
       <error id="error-2" indexes="2" label="error-2" alert="error-2"/>
       <error id="error-3" indexes="3" label="error-3" alert="error-3"/>
      </item> 
     </items> 
    </errors> 
            </xforms:instance>
      </xforms:model>
    </head>
    <body>
  <h1>Error List</h1>
  <h2>Error</h2>
  <table>
   <xforms:repeat nodeset="instance('errors-instance')/items/item[@id = instance('items')/items/item[index('repeat')]/id]/error" id="errors-repeat">
    <tr>
     <th>
      <xforms:output value="@label"/>
     </th>
     <td>
      <xforms:output value="@alert"/>
     </td>
    </tr>
   </xforms:repeat>
  </table>
  
  <h2>Items</h2>
  <table>
   <tr>
    <th>id</th>
   </tr> 
   <xforms:repeat nodeset="instance('items')/items/item" id="repeat">
    <tr>
     <td>
      <xforms:input ref="id"/>
     </td> 
    </tr> 
   </xforms:repeat> 
  </table> 
   </body>
</html>
   when I change focus from item/id='1' of xforms:input to item/id="2", I will receive a error info: "XForms error: repeatChildren and newNodeset have different sizes.".
   I think this is a bug! How can I do it?



昨 天 和 女 友 b u y 疯 了 ! ! !
年 末 万 种 精 品 大 促 销 , 8 0 万 大 奖 天 天 送 ( 绝 对 保 真 )

--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: repeat bug

Alessandro  Vernet
Administrator
I was able to reproduce it with your test case. We'll try to address
this one soon. In the meantime, you can track it at:

http://forge.objectweb.org/tracker/index.php?func=detail&aid=306531&group_id=168&atid=350207

Alex

On 12/21/06, hechengrong <[hidden email]> wrote:

> Hi.
>    I find a bug with xforms:repeat. There is My code:
> <html xmlns:xs="http://www.w3.org/2001/XMLSchema"
>       xmlns:xforms="http://www.w3.org/2002/xforms"
>       xmlns:ev="http://www.w3.org/2001/xml-events"
>       xmlns:xxforms="http://orbeon.org/oxf/xml/xforms"
>       xmlns:xi="http://www.w3.org/2001/XInclude"
>       xmlns:f="http://orbeon.org/oxf/xml/formatting"
>       xmlns:xhtml="http://www.w3.org/1999/xhtml"
>       xmlns:dmv="http://orbeon.org/oxf/examples/dmv"
>       xmlns:xxi="http://orbeon.org/oxf/xml/xinclude"
>       xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
>       xmlns="http://www.w3.org/1999/xhtml"
>    xmlns:fn="http://www.w3.org/2005/02/xpath-functions"
>       xsl:version="2.0">
>     <head>
>         <title>Error List</title>
>   <xforms:model id="main-model">
>    <xforms:instance id="items">
>     <form xmlns="">
>      <items>
>       <item>
>        <id>0</id>
>       </item>
>       <item>
>        <id>1</id>
>       </item>
>       <item>
>        <id>2</id>
>       </item>
>      </items>
>     </form>
>    </xforms:instance>
>             <xforms:instance id="errors-instance">
>                 <errors xmlns="">
>      <items>
>       <item id="0">
>       </item>
>       <item id="1">
>        <error id="error-1" indexes="1" label="error-1" alert="error-1"/>
>       </item>
>       <item id="2">
>        <error id="error-2" indexes="2" label="error-2" alert="error-2"/>
>        <error id="error-3" indexes="3" label="error-3" alert="error-3"/>
>       </item>
>      </items>
>     </errors>
>             </xforms:instance>
>       </xforms:model>
>     </head>
>     <body>
>   <h1>Error List</h1>
>   <h2>Error</h2>
>   <table>
>    <xforms:repeat
> nodeset="instance('errors-instance')/items/item[@id =
> instance('items')/items/item[index('repeat')]/id]/error"
> id="errors-repeat">
>     <tr>
>      <th>
>       <xforms:output value="@label"/>
>      </th>
>      <td>
>       <xforms:output value="@alert"/>
>      </td>
>     </tr>
>    </xforms:repeat>
>   </table>
>
>   <h2>Items</h2>
>   <table>
>    <tr>
>     <th>id</th>
>    </tr>
>    <xforms:repeat nodeset="instance('items')/items/item"
> id="repeat">
>     <tr>
>      <td>
>       <xforms:input ref="id"/>
>      </td>
>     </tr>
>    </xforms:repeat>
>   </table>
>    </body>
> </html>
>
>    when I change focus from item/id='1' of xforms:input to item/id="2", I
> will receive a error info: "XForms error: repeatChildren and newNodeset have
> different sizes.".
>    I think this is a bug! How can I do it?
>
>
>  昨 天 和 女 友 b u y 疯 了 ! ! !
>  年 末 万 种 精 品 大 促 销 , 8 0 万 大 奖 天 天 送 ( 绝 对 保 真 )
>
> --
> You receive this message as a subscriber of the [hidden email]
> mailing list.
> To unsubscribe: mailto:[hidden email]
> For general help: mailto:[hidden email]?subject=help
> ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
>
>
>

--
Blog (XML, Web apps, Open Source):
http://www.orbeon.com/blog/


--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet