Different posted data

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

Different posted data

pokusak
Hello.

I tried to follow ideas from this forum, but I can't finish form.
It looks and work good until I want to send the data.
In posted XML data is one elmenet "prva" which is not supposed to be there.
I think it should not be there because of bind element in model. I put there output element to see the value of count of following-siblings. First it looks ok, but after send it changes to weird values.

Here is code:

<?xml version="1.0" encoding="UTF-8"?>
<xhtml:html xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:ev="http://www.w3.org/2001/xml-events" xmlns:xforms="http://www.w3.org/2002/xforms" xmlns:xs="http://www.w3.org/2001/XMLSchema">
  <xhtml:head>
    <xforms:model>
      <xforms:instance>
        <first>
          <prva nazov="Level1-1">
            <druha>Level2-1</druha>
            <druha>Level2-2</druha>
            <druha>Level2-3</druha>
          </prva>
          <prva nazov="VZOR">
            <druha />
          </prva>
        </first>
      </xforms:instance>
      <xforms:bind nodeset="/first/prva" relevant="count(following-sibling::prva) &gt; 0" />
      <xforms:bind nodeset="/first/prva/druha" relevant="count(following-sibling::druha) &gt; 0" />
      <xforms:submission action="http://xformstest.org/cgi-bin/echo.sh" id="id2" method="post" />
    </xforms:model>
  </xhtml:head>
  <xhtml:body>
    <xforms:repeat id="prva" nodeset="prva">
      <xhtml:div style="margin-left: 2em">
        <xforms:output ref="@nazov" />
        following-sibling:
        <xforms:output value="count(following-sibling::prva)" />
        <xhtml:br />
        <xforms:repeat id="druha" nodeset="druha">
          <xhtml:div style="margin-left: 2em">
            <xforms:input ref="." />
            <xforms:trigger>
              <xforms:label>Delete</xforms:label>
              <xforms:delete at="index('druha')" ev:event="DOMActivate" nodeset="/first/prva[index('prva')]/druha" />
            </xforms:trigger>
          </xhtml:div>
        </xforms:repeat>
        <xforms:trigger>
          <xforms:label>druhaAdd</xforms:label>
          <xforms:insert at="last()+1" ev:event="DOMActivate" nodeset="/first/prva[index('prva')]/druha" position="after" />
        </xforms:trigger>
      </xhtml:div>
    </xforms:repeat>
    <xhtml:br />
    <xhtml:div style="margin-left: 2em">
      <xforms:trigger>
        <xforms:label>PRVA add</xforms:label>
        <xforms:insert at="last()+1" ev:event="DOMActivate" nodeset="/first/prva" position="after" />
      </xforms:trigger>
      <xforms:trigger>
        <xforms:label>PRVA delete</xforms:label>
        <xforms:delete at="index('prva')" ev:event="DOMActivate" nodeset="/first/prva" />
      </xforms:trigger>
    </xhtml:div>
    <xhtml:br />
    <xhtml:div style="margin-left: 2em">
      <xforms:submit submission="id2">
        <xforms:label>Send</xforms:label>
      </xforms:submit>
    </xhtml:div>
  </xhtml:body>
</xhtml:html>

Just run form and send it. Why are there 2 elements prva?

Thanks a lot.



--
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: Different posted data

Ryan Puddephatt
Try replacing &gt; with gt in the binds

Ryan Puddephatt
Software Engineer

Teleflex Group - IT UK
1 Michaelson Square
Livingston
West Lothian
Scotland
EH54 7DP

e> [hidden email]
t> +44(0)1506 407 110
f> +44(0)1506 407 108

 

>-----Original Message-----
>From: [hidden email] [mailto:[hidden email]]
>Sent: 11 September 2006 13:18
>To: [hidden email]
>Subject: [ops-users] Different posted data
>
>Hello.
>
>I tried to follow ideas from this forum, but I can't finish form.
>It looks and work good until I want to send the data.
>In posted XML data is one elmenet "prva" which is not supposed
>to be there.
>I think it should not be there because of bind element in
>model. I put there output element to see the value of count of
>following-siblings. First it looks ok, but after send it
>changes to weird values.
>
>Here is code:
>
><?xml version="1.0" encoding="UTF-8"?>
><xhtml:html xmlns:xhtml="http://www.w3.org/1999/xhtml"
>xmlns:ev="http://www.w3.org/2001/xml-events"
>xmlns:xforms="http://www.w3.org/2002/xforms"
>xmlns:xs="http://www.w3.org/2001/XMLSchema">
>  <xhtml:head>
>    <xforms:model>
>      <xforms:instance>
>        <first>
>          <prva nazov="Level1-1">
>            <druha>Level2-1</druha>
>            <druha>Level2-2</druha>
>            <druha>Level2-3</druha>
>          </prva>
>          <prva nazov="VZOR">
>            <druha />
>          </prva>
>        </first>
>      </xforms:instance>
>      <xforms:bind nodeset="/first/prva"
>relevant="count(following-sibling::prva) &gt; 0" />
>      <xforms:bind nodeset="/first/prva/druha"
>relevant="count(following-sibling::druha) &gt; 0" />
>      <xforms:submission
>action="http://xformstest.org/cgi-bin/echo.sh" id="id2"
>method="post" />
>    </xforms:model>
>  </xhtml:head>
>  <xhtml:body>
>    <xforms:repeat id="prva" nodeset="prva">
>      <xhtml:div style="margin-left: 2em">
>        <xforms:output ref="@nazov" />
>        following-sibling:
>        <xforms:output value="count(following-sibling::prva)" />
>        <xhtml:br />
>        <xforms:repeat id="druha" nodeset="druha">
>          <xhtml:div style="margin-left: 2em">
>            <xforms:input ref="." />
>            <xforms:trigger>
>              <xforms:label>Delete</xforms:label>
>              <xforms:delete at="index('druha')"
>ev:event="DOMActivate" nodeset="/first/prva[index('prva')]/druha" />
>            </xforms:trigger>
>          </xhtml:div>
>        </xforms:repeat>
>        <xforms:trigger>
>          <xforms:label>druhaAdd</xforms:label>
>          <xforms:insert at="last()+1" ev:event="DOMActivate"
>nodeset="/first/prva[index('prva')]/druha" position="after" />
>        </xforms:trigger>
>      </xhtml:div>
>    </xforms:repeat>
>    <xhtml:br />
>    <xhtml:div style="margin-left: 2em">
>      <xforms:trigger>
>        <xforms:label>PRVA add</xforms:label>
>        <xforms:insert at="last()+1" ev:event="DOMActivate"
>nodeset="/first/prva" position="after" />
>      </xforms:trigger>
>      <xforms:trigger>
>        <xforms:label>PRVA delete</xforms:label>
>        <xforms:delete at="index('prva')"
>ev:event="DOMActivate" nodeset="/first/prva" />
>      </xforms:trigger>
>    </xhtml:div>
>    <xhtml:br />
>    <xhtml:div style="margin-left: 2em">
>      <xforms:submit submission="id2">
>        <xforms:label>Send</xforms:label>
>      </xforms:submit>
>    </xhtml:div>
>  </xhtml:body>
></xhtml:html>
>
>Just run form and send it. Why are there 2 elements prva?
>
>Thanks a lot.
>
>



--
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: Different posted data

Alexander Žaťko
In reply to this post by pokusak
The submission of the default (as loaded) form state seems to work as  
expected in XSmiles browser:

<?xml version="1.0" encoding="UTF-8"?>
<first xmlns:ev="http://www.w3.org/2001/xml-events"
xmlns:xforms="http://www.w3.org/2002/xforms"
xmlns:xhtml="http://www.w3.org/1999/xhtml"
xmlns:xs="http://www.w3.org/2001/XMLSchema">
        <prva nazov="Level1-1">
                <druha>Level2-1</druha>
                <druha>Level2-2</druha>
        </prva>
</first>

...so I would suspect a bug in OPS.

A.


On Sep 11, 2006, at 8:17 AM, [hidden email] wrote:

> Hello.
>
> I tried to follow ideas from this forum, but I can't finish form.
> It looks and work good until I want to send the data.
> In posted XML data is one elmenet "prva" which is not supposed to  
> be there.
> I think it should not be there because of bind element in model. I  
> put there output element to see the value of count of following-
> siblings. First it looks ok, but after send it changes to weird  
> values.
>
> Here is code:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <xhtml:html xmlns:xhtml="http://www.w3.org/1999/xhtml"  
> xmlns:ev="http://www.w3.org/2001/xml-events" xmlns:xforms="http://
> www.w3.org/2002/xforms" xmlns:xs="http://www.w3.org/2001/XMLSchema">
>   <xhtml:head>
>     <xforms:model>
>       <xforms:instance>
>         <first>
>           <prva nazov="Level1-1">
>             <druha>Level2-1</druha>
>             <druha>Level2-2</druha>
>             <druha>Level2-3</druha>
>           </prva>
>           <prva nazov="VZOR">
>             <druha />
>           </prva>
>         </first>
>       </xforms:instance>
>       <xforms:bind nodeset="/first/prva" relevant="count(following-
> sibling::prva) &gt; 0" />
>       <xforms:bind nodeset="/first/prva/druha" relevant="count
> (following-sibling::druha) &gt; 0" />
>       <xforms:submission action="http://xformstest.org/cgi-bin/ 
> echo.sh" id="id2" method="post" />
>     </xforms:model>
>   </xhtml:head>
>   <xhtml:body>
>     <xforms:repeat id="prva" nodeset="prva">
>       <xhtml:div style="margin-left: 2em">
>         <xforms:output ref="@nazov" />
>         following-sibling:
>         <xforms:output value="count(following-sibling::prva)" />
>         <xhtml:br />
>         <xforms:repeat id="druha" nodeset="druha">
>           <xhtml:div style="margin-left: 2em">
>             <xforms:input ref="." />
>             <xforms:trigger>
>               <xforms:label>Delete</xforms:label>
>               <xforms:delete at="index('druha')"  
> ev:event="DOMActivate" nodeset="/first/prva[index('prva')]/druha" />
>             </xforms:trigger>
>           </xhtml:div>
>         </xforms:repeat>
>         <xforms:trigger>
>           <xforms:label>druhaAdd</xforms:label>
>           <xforms:insert at="last()+1" ev:event="DOMActivate"  
> nodeset="/first/prva[index('prva')]/druha" position="after" />
>         </xforms:trigger>
>       </xhtml:div>
>     </xforms:repeat>
>     <xhtml:br />
>     <xhtml:div style="margin-left: 2em">
>       <xforms:trigger>
>         <xforms:label>PRVA add</xforms:label>
>         <xforms:insert at="last()+1" ev:event="DOMActivate"  
> nodeset="/first/prva" position="after" />
>       </xforms:trigger>
>       <xforms:trigger>
>         <xforms:label>PRVA delete</xforms:label>
>         <xforms:delete at="index('prva')" ev:event="DOMActivate"  
> nodeset="/first/prva" />
>       </xforms:trigger>
>     </xhtml:div>
>     <xhtml:br />
>     <xhtml:div style="margin-left: 2em">
>       <xforms:submit submission="id2">
>         <xforms:label>Send</xforms:label>
>       </xforms:submit>
>     </xhtml:div>
>   </xhtml:body>
> </xhtml:html>
>
> Just run form and send it. Why are there 2 elements prva?
>
> Thanks a lot.
>
>
> --
> You receive this message as a subscriber of the ops-
> [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



--
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: RE: Different posted data

pokusak
In reply to this post by pokusak
It doesn't help. Still the same.

>-----Puvodni zprava-----
>Od: Ryan Puddephatt [mailto:[hidden email]]
>Odesl?no: 11. z??? 2006 12:25
>Komu: [hidden email]
>P?edm?t: RE: [ops-users] Different posted data
>
>
>Try replacing > with gt in the binds
>
>Ryan Puddephatt
>Software Engineer
>
>Teleflex Group - IT UK
>1 Michaelson Square
>Livingston
>West Lothian
>Scotland
>EH54 7DP
>
>e> [hidden email]
>t> +44(0)1506 407 110
>f> +44(0)1506 407 108
>
>
>
>>-----Original Message-----
>>From: [hidden email] [mailto:[hidden email]]
>>Sent: 11 September 2006 13:18
>>To: [hidden email]
>>Subject: [ops-users] Different posted data
>>
>>Hello.
>>
>>I tried to follow ideas from this forum, but I can't finish form.
>>It looks and work good until I want to send the data.
>>In posted XML data is one elmenet "prva" which is not supposed
>>to be there.
>>I think it should not be there because of bind element in
>>model. I put there output element to see the value of count of
>>following-siblings. First it looks ok, but after send it
>>changes to weird values.
>>
>>Here is code:
>>
>><?xml version="1.0" encoding="UTF-8"?>
>><xhtml:html xmlns:xhtml="http://www.w3.org/1999/xhtml"
>>xmlns:ev="http://www.w3.org/2001/xml-events"
>>xmlns:xforms="http://www.w3.org/2002/xforms"
>>xmlns:xs="http://www.w3.org/2001/XMLSchema">
>>  <xhtml:head>
>>    <xforms:model>
>>      <xforms:instance>
>>        <first>
>>          <prva nazov="Level1-1">
>>            <druha>Level2-1</druha>
>>            <druha>Level2-2</druha>
>>            <druha>Level2-3</druha>
>>          </prva>
>>          <prva nazov="VZOR">
>>            <druha />
>>          </prva>
>>        </first>
>>      </xforms:instance>
>>      <xforms:bind nodeset="/first/prva"
>>relevant="count(following-sibling::prva) > 0" />
>>      <xforms:bind nodeset="/first/prva/druha"
>>relevant="count(following-sibling::druha) > 0" />
>>      <xforms:submission
>>action="http://xformstest.org/cgi-bin/echo.sh" id="id2"
>>method="post" />
>>    </xforms:model>
>>  </xhtml:head>
>>  <xhtml:body>
>>    <xforms:repeat id="prva" nodeset="prva">
>>      <xhtml:div style="margin-left: 2em">
>>        <xforms:output ref="@nazov" />
>>        following-sibling:
>>        <xforms:output value="count(following-sibling::prva)" />
>>        <xhtml:br />
>>        <xforms:repeat id="druha" nodeset="druha">
>>          <xhtml:div style="margin-left: 2em">
>>            <xforms:input ref="." />
>>            <xforms:trigger>
>>              <xforms:label>Delete</xforms:label>
>>              <xforms:delete at="index('druha')"
>>ev:event="DOMActivate" nodeset="/first/prva[index('prva')]/druha" />
>>            </xforms:trigger>
>>          </xhtml:div>
>>        </xforms:repeat>
>>        <xforms:trigger>
>>          <xforms:label>druhaAdd</xforms:label>
>>          <xforms:insert at="last()+1" ev:event="DOMActivate"
>>nodeset="/first/prva[index('prva')]/druha" position="after" />
>>        </xforms:trigger>
>>      </xhtml:div>
>>    </xforms:repeat>
>>    <xhtml:br />
>>    <xhtml:div style="margin-left: 2em">
>>      <xforms:trigger>
>>        <xforms:label>PRVA add</xforms:label>
>>        <xforms:insert at="last()+1" ev:event="DOMActivate"
>>nodeset="/first/prva" position="after" />
>>      </xforms:trigger>
>>      <xforms:trigger>
>>        <xforms:label>PRVA delete</xforms:label>
>>        <xforms:delete at="index('prva')"
>>ev:event="DOMActivate" nodeset="/first/prva" />
>>      </xforms:trigger>
>>    </xhtml:div>
>>    <xhtml:br />
>>    <xhtml:div style="margin-left: 2em">
>>      <xforms:submit submission="id2">
>>        <xforms:label>Send</xforms:label>
>>      </xforms:submit>
>>    </xhtml:div>
>>  </xhtml:body>
>></xhtml:html>
>>
>>Just run form and send it. Why are there 2 elements prva?
>>
>>Thanks a lot.
>>
>>





--
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: Different posted data

Erik Bruchez
Administrator
In reply to this post by pokusak
This is a puzzling issue. I followed the code with the debugger and I
can tell that the first time, relevance is correctly applied, but the
second time around (just before submission), not. So I suspect that you
have hit another instance of these bugs:

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

This always seems related to the following-sibling:: axis, and for now
you should work around with not using that axis, for example with:

<xforms:bind nodeset="/first/prva[position() = last()]" relevant="false()"/>

Hopefully updating to the latest version of Saxon will fix this.

And thanks for the reproducible case!

-Erik

[hidden email] wrote:

> Hello.
>
> I tried to follow ideas from this forum, but I can't finish form.
> It looks and work good until I want to send the data.
> In posted XML data is one elmenet "prva" which is not supposed to be there.
> I think it should not be there because of bind element in model. I put there output element to see the value of count of following-siblings. First it looks ok, but after send it changes to weird values.
>
> Here is code:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <xhtml:html xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:ev="http://www.w3.org/2001/xml-events" xmlns:xforms="http://www.w3.org/2002/xforms" xmlns:xs="http://www.w3.org/2001/XMLSchema">
>   <xhtml:head>
>     <xforms:model>
>       <xforms:instance>
>         <first>
>           <prva nazov="Level1-1">
>             <druha>Level2-1</druha>
>             <druha>Level2-2</druha>
>             <druha>Level2-3</druha>
>           </prva>
>           <prva nazov="VZOR">
>             <druha />
>           </prva>
>         </first>
>       </xforms:instance>
>       <xforms:bind nodeset="/first/prva" relevant="count(following-sibling::prva) &gt; 0" />
>       <xforms:bind nodeset="/first/prva/druha" relevant="count(following-sibling::druha) &gt; 0" />
>       <xforms:submission action="http://xformstest.org/cgi-bin/echo.sh" id="id2" method="post" />
>     </xforms:model>
>   </xhtml:head>
>   <xhtml:body>
>     <xforms:repeat id="prva" nodeset="prva">
>       <xhtml:div style="margin-left: 2em">
>         <xforms:output ref="@nazov" />
>         following-sibling:
>         <xforms:output value="count(following-sibling::prva)" />
>         <xhtml:br />
>         <xforms:repeat id="druha" nodeset="druha">
>           <xhtml:div style="margin-left: 2em">
>             <xforms:input ref="." />
>             <xforms:trigger>
>               <xforms:label>Delete</xforms:label>
>               <xforms:delete at="index('druha')" ev:event="DOMActivate" nodeset="/first/prva[index('prva')]/druha" />
>             </xforms:trigger>
>           </xhtml:div>
>         </xforms:repeat>
>         <xforms:trigger>
>           <xforms:label>druhaAdd</xforms:label>
>           <xforms:insert at="last()+1" ev:event="DOMActivate" nodeset="/first/prva[index('prva')]/druha" position="after" />
>         </xforms:trigger>
>       </xhtml:div>
>     </xforms:repeat>
>     <xhtml:br />
>     <xhtml:div style="margin-left: 2em">
>       <xforms:trigger>
>         <xforms:label>PRVA add</xforms:label>
>         <xforms:insert at="last()+1" ev:event="DOMActivate" nodeset="/first/prva" position="after" />
>       </xforms:trigger>
>       <xforms:trigger>
>         <xforms:label>PRVA delete</xforms:label>
>         <xforms:delete at="index('prva')" ev:event="DOMActivate" nodeset="/first/prva" />
>       </xforms:trigger>
>     </xhtml:div>
>     <xhtml:br />
>     <xhtml:div style="margin-left: 2em">
>       <xforms:submit submission="id2">
>         <xforms:label>Send</xforms:label>
>       </xforms:submit>
>     </xhtml:div>
>   </xhtml:body>
> </xhtml:html>
>
> Just run form and send it. Why are there 2 elements prva?
>
> Thanks a lot.
>
>
>
> ------------------------------------------------------------------------
>
>
> --
> 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

--
Orbeon - XForms Everywhere:
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