disabled controls bindset failure

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
14 messages Options
Reply | Threaded
Open this post in threaded view
|

disabled controls bindset failure

ther
Readers,

According to the document 'xforms for authors part 1', it is possible
to disable control elements depending on values selected by the user.
I have tried the following:

<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN'
'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>
<html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en' lang='en'
xmlns:xf='http://www.w3.org/2002/xforms'>
        <head>
                <meta http-equiv='content-type' content='text/html;
charset=UTF-8' />
                <style type='text/css' id='internalstylesheet'>
                        code {text-color:black; background:white;
font-family:verdana, sans-serif}
                </style>
                <xf:model>
                        <xf:instance>
                                <generalinformation xmlns=''>
                                        <purpose />
                                        <stage />
                                </generalinformation>
                        </xf:instance>
                                <bind nodeset='stage'
relevant='../purpose="ewbrl"' />
                                <bind nodeset='stage'
relevant='../purpose="nibrf"' />
                        <xf:submission
                                resource='file:testsubmit.xml'
                                method='put'
                                id='gi'
                        />
                </xf:model>
                <title>
                </title>
        </head>
        <body>
                <p>
                        <xf:select1 appearance='minimal' ref='purpose'>
                                <xf:label>purpose of analysis
                                </xf:label>
                                <xf:item>
                                        <xf:label>
                                                England and Wales
Building Regulations part L
                                        </xf:label>
                                        <xf:value>ewbrl
                                        </xf:value>
                                </xf:item>
                                <xf:item>
                                        <xf:label>
                                                Scottish Building Regulations
                                        </xf:label>
                                        <xf:value>
                                                sbr
                                        </xf:value>
                                </xf:item>
                                <xf:item>
                                        <xf:label>
                                                Northern Ireland
Building Regulations part F
                                        </xf:label>
                                        <xf:value>
                                                nibrf
                                        </xf:value>
                                </xf:item>
                        </xf:select1>
                </p>
                <p>
                        <xf:select1 appearance='minimal' ref='stage'>
                                <!--should be disabled for purpose value sbr
                                -->
                                <xf:label>
                                        Stage of analysis
                                </xf:label>
                                <xf:item>
                                        <xf:label>
                                                As built
                                        </xf:label>
                                        <xf:value>
                                                asbuilt
                                        </xf:value>
                                </xf:item>
                                <xf:item>
                                        <xf:label>
                                                As designed
                                        </xf:label>
                                        <xf:value>
                                                asdesigned
                                        </xf:value>
                                </xf:item>
                        </xf:select1>
                </p>
                <xf:submit submission='gi'>
                <xf:label>
                Save
                </xf:label>
                </xf:submit>
        </body>
</html>

The required behaviour is that when the user selects 'scottish...',
the subsequent list menu should be greyed out, but in the browser
(firefox 20020, xforms 86ff2), the list menu 'stage of analysis'
continues to be visible. This form does not work with firefox 368,
xforms 87. Any help please?

Reply | Threaded
Open this post in threaded view
|

Re: disabled controls bindset failure

Ronald van Kuijk-4
In betterForm I get this error (after switching ' to " and vice-versa)

xforms-binding-exception: property 'relevant' already present at model item
Element causing Exception:/html[1]/head[1]/xf:model[1]/xf:bind[2]

This is not allowed according to the spec and an error should be thrown... Personally I always have 2 different XForms processors (BetterFORM and Orbeon, but I always use the former)  that I use to check if I'm wrong or the engine.

So if Mozilla XForms does not complain, it is in violation of the spec (see point 2 in http://www.w3.org/TR/xforms11/#evt-rebuild)

It can be solved by changing it to one bind:

      <xf:bind nodeset="stage" relevant="../purpose='ewbrl' or ../purpose='nibrf'" />

Cheers,

Ronald

Op 31-08-10 10:23, e-letter schreef:
Readers,

According to the document 'xforms for authors part 1', it is possible
to disable control elements depending on values selected by the user.
I have tried the following:

<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN'
'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>
<html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en' lang='en'
xmlns:xf='http://www.w3.org/2002/xforms'>
        <head>
                <meta http-equiv='content-type' content='text/html;
charset=UTF-8' />
                <style type='text/css' id='internalstylesheet'>
                        code {text-color:black; background:white;
font-family:verdana, sans-serif}
                </style>
                <xf:model>
                        <xf:instance>
                                <generalinformation xmlns=''>
                                        <purpose />
                                        <stage />
                                </generalinformation>
                        </xf:instance>
                                <bind nodeset='stage'
relevant='../purpose="ewbrl"' />
                                <bind nodeset='stage'
relevant='../purpose="nibrf"' />
                        <xf:submission
                                resource='file:testsubmit.xml'
                                method='put'
                                id='gi'
                        />
                </xf:model>
                <title>
                </title>
        </head>
        <body>
                <p>
                        <xf:select1 appearance='minimal' ref='purpose'>
                                <xf:label>purpose of analysis
                                </xf:label>
                                <xf:item>
                                        <xf:label>
                                                England and Wales
Building Regulations part L
                                        </xf:label>
                                        <xf:value>ewbrl
                                        </xf:value>
                                </xf:item>
                                <xf:item>
                                        <xf:label>
                                                Scottish Building Regulations
                                        </xf:label>
                                        <xf:value>
                                                sbr
                                        </xf:value>
                                </xf:item>
                                <xf:item>
                                        <xf:label>
                                                Northern Ireland
Building Regulations part F
                                        </xf:label>
                                        <xf:value>
                                                nibrf
                                        </xf:value>
                                </xf:item>
                        </xf:select1>
                </p>
                <p>
                        <xf:select1 appearance='minimal' ref='stage'>
                                <!--should be disabled for purpose value sbr
                                -->
                                <xf:label>
                                        Stage of analysis
                                </xf:label>
                                <xf:item>
                                        <xf:label>
                                                As built
                                        </xf:label>
                                        <xf:value>
                                                asbuilt
                                        </xf:value>
                                </xf:item>
                                <xf:item>
                                        <xf:label>
                                                As designed
                                        </xf:label>
                                        <xf:value>
                                                asdesigned
                                        </xf:value>
                                </xf:item>
                        </xf:select1>
                </p>
                <xf:submit submission='gi'>
                <xf:label>
                Save
                </xf:label>
                </xf:submit>
        </body>
</html>

The required behaviour is that when the user selects 'scottish...',
the subsequent list menu should be greyed out, but in the browser
(firefox 20020, xforms 86ff2), the list menu 'stage of analysis'
continues to be visible. This form does not work with firefox 368,
xforms 87. Any help please?



smime.p7s (4K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: disabled controls bindset failure

ther
On 31/08/2010, Ronald van Kuijk <[hidden email]> wrote:

>   In betterForm I get this error (after switching ' to " and vice-versa)
>
> xforms-binding-exception: property 'relevant' already present at model item
> *URL: *http://127.0.0.1:8080/betterform-trunk/forms/e-letter.xhtml
> *Element causing Exception:*/html[1]/head[1]/xf:model[1]/xf:bind[2]
> *
> *This is not allowed according to the spec and an error should be
> thrown... Personally I always have 2 different XForms processors
> (BetterFORM and Orbeon, but I always use the former)  that I use to
> check if I'm wrong or the engine.
>
> So if Mozilla XForms does not complain, it is in violation of the spec
> (see point 2 in http://www.w3.org/TR/xforms11/#evt-rebuild)
>
> It can be solved by changing it to one bind:
>
> <xf:bind nodeset="stage" relevant="../purpose='ewbrl' or
> ../purpose='nibrf'" />
>
What to do if the disable function is required for more than 1
condition (as described previously)?

Reply | Threaded
Open this post in threaded view
|

Re: disabled controls bindset failure

Ronald van Kuijk-4
  Op 31-08-10 11:59, e-letter schreef:

> On 31/08/2010, Ronald van Kuijk<[hidden email]>  wrote:
>>    In betterForm I get this error (after switching ' to " and vice-versa)
>>
>> xforms-binding-exception: property 'relevant' already present at model item
>> *URL: *http://127.0.0.1:8080/betterform-trunk/forms/e-letter.xhtml
>> *Element causing Exception:*/html[1]/head[1]/xf:model[1]/xf:bind[2]
>> *
>> *This is not allowed according to the spec and an error should be
>> thrown... Personally I always have 2 different XForms processors
>> (BetterFORM and Orbeon, but I always use the former)  that I use to
>> check if I'm wrong or the engine.
>>
>> So if Mozilla XForms does not complain, it is in violation of the spec
>> (see point 2 in http://www.w3.org/TR/xforms11/#evt-rebuild)
>>
>> It can be solved by changing it to one bind:
>>
>> <xf:bind nodeset="stage" relevant="../purpose='ewbrl' or
>> ../purpose='nibrf'" />
>>
> What to do if the disable function is required for more than 1
> condition (as described previously)?
That is what is done in what I proposed... there is an 'or'.... You can
use any xpath(2) depending on the engine




smime.p7s (4K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: disabled controls bindset failure

ther
In reply to this post by Ronald van Kuijk-4
On 31/08/2010, Ronald van Kuijk <[hidden email]> wrote:

>   In betterForm I get this error (after switching ' to " and vice-versa)
>
> xforms-binding-exception: property 'relevant' already present at model item
> *URL: *http://127.0.0.1:8080/betterform-trunk/forms/e-letter.xhtml
> *Element causing Exception:*/html[1]/head[1]/xf:model[1]/xf:bind[2]
> *
> *This is not allowed according to the spec and an error should be
> thrown... Personally I always have 2 different XForms processors
> (BetterFORM and Orbeon, but I always use the former)  that I use to
> check if I'm wrong or the engine.
>
> So if Mozilla XForms does not complain, it is in violation of the spec
> (see point 2 in http://www.w3.org/TR/xforms11/#evt-rebuild)
>
> It can be solved by changing it to one bind:
>
> <xf:bind nodeset="stage" relevant="../purpose='ewbrl' or
> ../purpose='nibrf'" />
>
This does not work so perhaps there is (another) bug with mozilla
xforms plug-in. If you know of another cross-platform web browser I
could use to test xforms please tell me, thank you.

Reply | Threaded
Open this post in threaded view
|

Re: disabled controls bindset failure

Ronald van Kuijk-4
  Op 31-08-10 12:53, e-letter schreef:

> On 31/08/2010, Ronald van Kuijk<[hidden email]>  wrote:
>>    In betterForm I get this error (after switching ' to " and vice-versa)
>>
>> xforms-binding-exception: property 'relevant' already present at model item
>> *URL: *http://127.0.0.1:8080/betterform-trunk/forms/e-letter.xhtml
>> *Element causing Exception:*/html[1]/head[1]/xf:model[1]/xf:bind[2]
>> *
>> *This is not allowed according to the spec and an error should be
>> thrown... Personally I always have 2 different XForms processors
>> (BetterFORM and Orbeon, but I always use the former)  that I use to
>> check if I'm wrong or the engine.
>>
>> So if Mozilla XForms does not complain, it is in violation of the spec
>> (see point 2 in http://www.w3.org/TR/xforms11/#evt-rebuild)
>>
>> It can be solved by changing it to one bind:
>>
>> <xf:bind nodeset="stage" relevant="../purpose='ewbrl' or
>> ../purpose='nibrf'" />
>>
> This does not work so perhaps there is (another) bug with mozilla
> xforms plug-in. If you know of another cross-platform web browser I
> could use to test xforms please tell me, thank you.
There is no other cross platform browser that supports xforms
(natively). Lots of other implementations can be found on
http://www.w3.org/MarkUp/Forms/wiki/XForms_Implementations. Some are
fully client side (personally I'd not recommend those, not because their
quality would be bad (I have no opinion) , but just that I do not trust
anything that just runs in th browser) or client-server combinations. As
mentioned before, I develop in betterFORM and if I encounter an issue
(behaviour I do not expect) I also test in Orbeon. With these you can
have XForms in *all* browsers.

Ronald


smime.p7s (4K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: disabled controls bindset failure

Alain COUTHURES
In reply to this post by ther
Hello,

You can have a look at XSLTForms (http://www.agencexml.com/xsltforms) which is a client-side implementation based on XSLT+AJAX and which I regularly compare with the Mozilla XForms extension.

Don't hesitate to test the SVN trunk version (or the dataisland branch).

Thank you for your feedbacks!

-Alain

On 31/08/2010, Ronald van Kuijk <[hidden email]> wrote:

>   In betterForm I get this error (after switching ' to " and vice-versa)
>
> xforms-binding-exception: property 'relevant' already present at model item
> *URL: *http://127.0.0.1:8080/betterform-trunk/forms/e-letter.xhtml
> *Element causing Exception:*/html[1]/head[1]/xf:model[1]/xf:bind[2]
> *
> *This is not allowed according to the spec and an error should be
> thrown... Personally I always have 2 different XForms processors
> (BetterFORM and Orbeon, but I always use the former)  that I use to
> check if I'm wrong or the engine.
>
> So if Mozilla XForms does not complain, it is in violation of the spec
> (see point 2 in http://www.w3.org/TR/xforms11/#evt-rebuild)
>
> It can be solved by changing it to one bind:
>
> <xf:bind nodeset="stage" relevant="../purpose='ewbrl' or
> ../purpose='nibrf'" />
>
This does not work so perhaps there is (another) bug with mozilla
xforms plug-in. If you know of another cross-platform web browser I
could use to test xforms please tell me, thank you.

Reply | Threaded
Open this post in threaded view
|

Re: disabled controls bindset failure

Aaron Reed
In reply to this post by ther
The reason that the 'or' xpath statement wasn't working was because of
all of the whitespace and new line characters that you have inside the
xf:value elements.  If you pare them down to <xf:value>ewbrl</xf:value>,
for example, it works.  I honestly don't remember my xforms and xpath
well enough to know if this is a bug or not.  If someone can cite the
appropriate spec section, I'll open a bug on it.

I will open a bug on the multiple relevant property definitions not
causing a xforms-binding-exception.  However, I need someone from the
xforms WG to tell us what the target of the xforms-binding-exception
should be in this case.  Should it be the xf:bind that tries to add the
already present model item property?  Or should it be someplace more
centric like the model that contains the bind?

Thanks,
--Aaron

e-letter wrote:

> On 31/08/2010, Ronald van Kuijk<[hidden email]>  wrote:
>>    In betterForm I get this error (after switching ' to " and vice-versa)
>>
>> xforms-binding-exception: property 'relevant' already present at model item
>> *URL: *http://127.0.0.1:8080/betterform-trunk/forms/e-letter.xhtml
>> *Element causing Exception:*/html[1]/head[1]/xf:model[1]/xf:bind[2]
>> *
>> *This is not allowed according to the spec and an error should be
>> thrown... Personally I always have 2 different XForms processors
>> (BetterFORM and Orbeon, but I always use the former)  that I use to
>> check if I'm wrong or the engine.
>>
>> So if Mozilla XForms does not complain, it is in violation of the spec
>> (see point 2 in http://www.w3.org/TR/xforms11/#evt-rebuild)
>>
>> It can be solved by changing it to one bind:
>>
>> <xf:bind nodeset="stage" relevant="../purpose='ewbrl' or
>> ../purpose='nibrf'" />
>>
> This does not work so perhaps there is (another) bug with mozilla
> xforms plug-in. If you know of another cross-platform web browser I
> could use to test xforms please tell me, thank you.
>
>




Reply | Threaded
Open this post in threaded view
|

Re: disabled controls bindset failure

John Boyer
In reply to this post by Alain COUTHURES

Also, please note that the Forms WG has previously advised implementers of XForms 1.1 to begin immediate experimentation with/support of the feature of allowing multiple model item properties per node, combined in a manner that makes sense for each model item property.

The advisory notification was issued here:
http://lists.w3.org/Archives/Public/www-forms/2010Apr/0006.html

The manner of combination was specified here:
http://www.w3.org/MarkUp/Forms/wiki/MIPS

So, if anyone wanted to "fix" their implementation to support the double use of relevant in this sample form, so much the better.

Cheers,
John M. Boyer, Ph.D.
IBM Distinguished Engineer, Interactive Web Applications and Documents
IBM Lotus Forms Architect
Workplace, Portal and Collaboration Software
IBM Canada Software Lab, Victoria
E-Mail: [hidden email]  

Blog:
http://www.ibm.com/developerworks/blogs/page/JohnBoyer
Blog RSS feed:
http://www.ibm.com/developerworks/blogs/rss/JohnBoyer?flavor=rssdw




From: [hidden email]
To: <[hidden email]>, <[hidden email]>
Cc: <[hidden email]>
Date: 08/31/2010 04:21 AM
Subject: Re: disabled controls bindset failure





Hello,

You can have a look at XSLTForms (
http://www.agencexml.com/xsltforms) which is a client-side implementation based on XSLT+AJAX and which I regularly compare with the Mozilla XForms extension.

Don't hesitate to test the SVN trunk version (or the dataisland branch).

Thank you for your feedbacks!

-Alain

On 31/08/2010, Ronald van Kuijk <[hidden email]> wrote:
>   In betterForm I get this error (after switching ' to " and vice-versa)
>
> xforms-binding-exception: property 'relevant' already present at model item
> *URL: *http://127.0.0.1:8080/betterform-trunk/forms/e-letter.xhtml
> *Element causing Exception:*/html[1]/head[1]/xf:model[1]/xf:bind[2]
> *
> *This is not allowed according to the spec and an error should be
> thrown... Personally I always have 2 different XForms processors
> (BetterFORM and Orbeon, but I always use the former)  that I use to
> check if I'm wrong or the engine.
>
> So if Mozilla XForms does not complain, it is in violation of the spec
> (see point 2 in
http://www.w3.org/TR/xforms11/#evt-rebuild)
>
> It can be solved by changing it to one bind:
>
> <xf:bind nodeset="stage" relevant="../purpose='ewbrl' or
> ../purpose='nibrf'" />
>
This does not work so perhaps there is (another) bug with mozilla
xforms plug-in. If you know of another cross-platform web browser I
could use to test xforms please tell me, thank you.



Reply | Threaded
Open this post in threaded view
|

Re: disabled controls bindset failure

Aaron Reed
In reply to this post by Aaron Reed
Actually, I was wrong.  We already support throwing
xforms-binding-exception's during xforms-rebuild in the mozilla xforms
processor if we determine the same MIP has been added more than once.
The bug was in the testcase.  The bind elements in the original form are
missing the 'xf' namespace prefix so we weren't processing them as
xforms bind elements.  The parser saw them as xhtml bind elements.

--Aaron

Aaron Reed wrote:

>
> I will open a bug on the multiple relevant property definitions not
> causing a xforms-binding-exception. However, I need someone from the
> xforms WG to tell us what the target of the xforms-binding-exception
> should be in this case. Should it be the xf:bind that tries to add the
> already present model item property? Or should it be someplace more
> centric like the model that contains the bind?
>
> Thanks,
> --Aaron
>
> e-letter wrote:
>> On 31/08/2010, Ronald van Kuijk<[hidden email]> wrote:
>>> In betterForm I get this error (after switching ' to " and vice-versa)
>>>
>>> xforms-binding-exception: property 'relevant' already present at
>>> model item
>>> *URL: *http://127.0.0.1:8080/betterform-trunk/forms/e-letter.xhtml
>>> *Element causing Exception:*/html[1]/head[1]/xf:model[1]/xf:bind[2]
>>> *
>>> *This is not allowed according to the spec and an error should be
>>> thrown... Personally I always have 2 different XForms processors
>>> (BetterFORM and Orbeon, but I always use the former) that I use to
>>> check if I'm wrong or the engine.
>>>
>>> So if Mozilla XForms does not complain, it is in violation of the spec
>>> (see point 2 in http://www.w3.org/TR/xforms11/#evt-rebuild)
>>>
>>> It can be solved by changing it to one bind:
>>>
>>> <xf:bind nodeset="stage" relevant="../purpose='ewbrl' or
>>> ../purpose='nibrf'" />
>>>
>> This does not work so perhaps there is (another) bug with mozilla
>> xforms plug-in. If you know of another cross-platform web browser I
>> could use to test xforms please tell me, thank you.
>>
>>
>
>
>
>
>




Reply | Threaded
Open this post in threaded view
|

Re: disabled controls bindset failure

ther
On 31/08/2010, Aaron Reed <[hidden email]> wrote:
> Actually, I was wrong.  We already support throwing
> xforms-binding-exception's during xforms-rebuild in the mozilla xforms
> processor if we determine the same MIP has been added more than once.
> The bug was in the testcase.  The bind elements in the original form are
> missing the 'xf' namespace prefix so we weren't processing them as
> xforms bind elements.  The parser saw them as xhtml bind elements.
>
I added the prefix 'xf:' to the bind element, but now the list menu
disappears completely. When the bind element is removed, the list menu
appears.

Reply | Threaded
Open this post in threaded view
|

Re: disabled controls bindset failure

Aaron Reed
In the updated version of your form (using the xpath 'or' in the
relevant expression), the "stage of analysis" select1 should be hidden
when the form is first loaded because the initial value of the stage
node is neither 'ewbrl' nor 'nibrf'.  Selecting one of those items in
the first select1 should make the second select1 appear.

In the original testcase if you added xf: to the bind element, you
should get the xforms-binding-exception.  Because that is a fatal error,
the form is in an unknown state once that error is reported.

This is the updated version of your form that I'm using now, which works
fine for me on Firefox:

<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN'
'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>
<html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en' lang='en'
xmlns:xf='http://www.w3.org/2002/xforms'
xmlns:ev='http://www.w3.org/2001/xml-events '>
         <head>
                 <meta http-equiv='content-type' content='text/html;
charset=UTF-8' />
                 <style type='text/css' id='internalstylesheet'>
                         code {text-color:black; background:white;
font-family:verdana, sans-serif}
                 </style>
                 <xf:model>
                     <xf:message level="modal"
ev:event="xforms-binding-exception">xforms-binding-exception
happened</xf:message>
                         <xf:instance>
                                 <generalinformation xmlns=''>
                                         <purpose />
                                         <stage />
                                 </generalinformation>
                         </xf:instance>
<!--
                                 <xf:bind nodeset='stage'
relevant='../purpose="ewbrl"' />
                                 <xf:bind nodeset='stage'
relevant='../purpose="nibrf"' />
-->
<xf:bind nodeset='stage' relevant='../purpose="ewbrl" or
.../purpose="nibrf"' />

                         <xf:submission
                                 resource='file:testsubmit.xml'
                                 method='put'
                                 id='gi'
                         />
                 </xf:model>
                 <title>
                 </title>
         </head>
         <body>
                 <p>
                         <xf:select1 appearance='minimal' ref='purpose'>
                                 <xf:label>purpose of analysis
                                 </xf:label>
                                 <xf:item>
                                         <xf:label>
                                                 England and Wales
Building Regulations part L
                                         </xf:label>
                                         <xf:value>ewbrl</xf:value>
                                 </xf:item>
                                 <xf:item>
                                         <xf:label>
                                                 Scottish Building
Regulations
                                         </xf:label>
                                         <xf:value>sbr</xf:value>
                                 </xf:item>
                                 <xf:item>
                                         <xf:label>
                                                 Northern Ireland
Building Regulations part F
                                         </xf:label>
                                         <xf:value>nibrf</xf:value>
                                 </xf:item>
                         </xf:select1>
                 </p>
                 <p>
                         <xf:select1 appearance='minimal' ref='stage'>
                                 <!--should be disabled for purpose
value sbr
                                 -->
                                 <xf:label>
                                         Stage of analysis
                                 </xf:label>
                                 <xf:item>
                                         <xf:label>
                                                 As built
                                         </xf:label>
                                         <xf:value>
                                                 asbuilt
                                         </xf:value>
                                 </xf:item>
                                 <xf:item>
                                         <xf:label>
                                                 As designed
                                         </xf:label>
                                         <xf:value>
                                                 asdesigned
                                         </xf:value>
                                 </xf:item>
                         </xf:select1>
                 </p>
                 <xf:submit submission='gi'>
                 <xf:label>
                 Save
                 </xf:label>
                 </xf:submit>
         </body>
</html>

Hope that this helps,
--Aaron

e-letter wrote:

> On 31/08/2010, Aaron Reed<[hidden email]>  wrote:
>> Actually, I was wrong.  We already support throwing
>> xforms-binding-exception's during xforms-rebuild in the mozilla xforms
>> processor if we determine the same MIP has been added more than once.
>> The bug was in the testcase.  The bind elements in the original form are
>> missing the 'xf' namespace prefix so we weren't processing them as
>> xforms bind elements.  The parser saw them as xhtml bind elements.
>>
> I added the prefix 'xf:' to the bind element, but now the list menu
> disappears completely. When the bind element is removed, the list menu
> appears.
>
>




Reply | Threaded
Open this post in threaded view
|

Re: disabled controls bindset failure

C. M. Sperberg-McQueen-2
In reply to this post by Aaron Reed

On 31 Aug 2010, at 10:43 , Aaron Reed wrote:

> The reason that the 'or' xpath statement wasn't working was because  
> of all of the whitespace and new line characters that you have  
> inside the xf:value elements.  If you pare them down to  
> <xf:value>ewbrl</xf:value>, for example, it works.  I honestly don't  
> remember my xforms and xpath well enough to know if this is a bug or  
> not.  If someone can cite the appropriate spec section, I'll open a  
> bug on it.

I don't think it's a bug, at least not on the evidence
before us at the moment.

[Warning:  spec-prose pedantry alert.  If you aren't in
the mood for spec-language-lawyering, you will not find
the rest of this note interesting or amusing and you can
stop reading now.]

The XML spec specifies that in values of all attributes, each
white space character should be replaced by a blank.  For
attributes of type other than CDATA, the further normalization
step is applied of stripping leading and trailing blanks, and
reducing each maximal contiguous sequence of blanks to a
single blank.  This means that if the attribute is declared
as (for example) NMTOKEN, the two attributes

   foo = "
                bar
         "

and

   foo = "bar"

appear identical to downstream applications.  And of course
if it's a CDATA attribute they don't appear the same.

Attributes for which no declaration is available are treated
as CDATA.

(XML spec, sec. 3.3.3 http://www.w3.org/TR/xml/#AVNormalize)

There is no similar provision in the basic XML spec for
whitespace normalization of parsed character data in elements.
(Sorry, no section to cite for that, I just know it to be
true. :)

XSD 1.0 and 1.1, by contrast, do allow definition of types for
character data that involve whitespace normalization of the
kind defined in the XML spec both for CDATA attributes and
for other attributes.  When attributes and elements are governed
by those whitespace-normalizing types, then the string in
the input document is whitespace normalized before it is
checked to see whether it's in the lexical space of the type.

The consequence of this is that an element

   <e xsi:type="xsd:integer">   43 </e>

is valid against the integer type, even though "  43 " is
not a member of the lexical space of the integer type.

The XForms 1.1 spec says (in section 8.3.3)

     Data Binding Restriction: All lexical values must be valid
     according to the datatype bound to the selection control.
     If the single node binding attributes are used and indicate
     a node in a model other than the bound node of the containing
     selection control, then an xforms-binding-exception must occur.

There is a terminological gap between this prose and that
of the XSD specs, but I take this to mean that (in XSD terms)
the storage value indicated or contained by the xf:value
element should be in the lexical space of the datatype
bound to the item.  That is, this doesn't look to me as if the
XForms spec required whitespace normalization.  (If it's
intended that whitespace normalization be performed, maybe
a clarification would be in order.)

So I infer that even if the instance document in the example
had a schema declaring the 'purpose' element to be of type
NMTOKEN or some other datatype with whitespace='strip', the
lexical value that should be produced in the example has a lot of
blanks in it.

So the question of a possible bug comes down to the
XPath rules for evaluating ../purpose="ewbrl", where
..purpose evaluates to something like

   "ewbrl                                        "

Here, too, I can't cite a section (if it becomes urgent, I'll
try), but XPath does not prescribe normalization of strings
before comparison, and does not expect "ewbrl" = "ewbrl   "
to evaluate to true.

So -- no bug that I can see, but the XForms WG may want to
weigh in on whether they intended datatype-based whitespace
normalization.

--
****************************************************************
* C. M. Sperberg-McQueen, Black Mesa Technologies LLC
* http://www.blackmesatech.com
* http://cmsmcq.com/mib
* http://balisage.net
****************************************************************





Reply | Threaded
Open this post in threaded view
|

Re: disabled controls bindset failure

Steven Pemberton-3
In reply to this post by ther
Sorry for the rather late answer to this question.

I see some potential errors here:

        No xf: on the bind elements. That would stop it working immediately.
        You should combine the two binds for the same nodeset into one bind,  
since that is what the spec says you should do:

                <xf:bind nodeset='stage' relevant='../purpose="ewbrl" or  
relevant='../purpose="nibrf"' />
        or
                 <xf:bind nodeset='stage' relevant='../purpose!="sbr"' />

        If the data value is a string (as in this case) then <xf:value>    
nibrf    </xf:value> is different to <xf:value>nibrf</xf:value> since  
there are extra spaces in there. So the test ../purpose="nibrf" will never  
work.

With those changes it worked for me.

Best wishes,

Steven pemberton

On Tue, 31 Aug 2010 10:23:06 +0200, e-letter <[hidden email]> wrote:

> <?xml version='1.0' encoding='UTF-8'?>
> <!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN'
> 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>
> <html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en' lang='en'
> xmlns:xf='http://www.w3.org/2002/xforms'>
>         <head>
>                 <meta http-equiv='content-type' content='text/html;
> charset=UTF-8' />
>                 <style type='text/css' id='internalstylesheet'>
>                         code {text-color:black; background:white;
> font-family:verdana, sans-serif}
>                 </style>
>                 <xf:model>
>                         <xf:instance>
>                                 <generalinformation xmlns=''>
>                                         <purpose />
>                                         <stage />
>                                 </generalinformation>
>                         </xf:instance>
>                                 <bind nodeset='stage'
> relevant='../purpose="ewbrl"' />
>                                 <bind nodeset='stage'
> relevant='../purpose="nibrf"' />
>                         <xf:submission
>                                 resource='file:testsubmit.xml'
>                                 method='put'
>                                 id='gi'
>                         />
>                 </xf:model>
>                 <title>
>                 </title>
>         </head>
>         <body>
>                 <p>
>                         <xf:select1 appearance='minimal' ref='purpose'>
>                                 <xf:label>purpose of analysis
>                                 </xf:label>
>                                 <xf:item>
>                                         <xf:label>
>                                                 England and Wales
> Building Regulations part L
>                                         </xf:label>
>                                         <xf:value>ewbrl
>                                         </xf:value>
>                                 </xf:item>
>                                 <xf:item>
>                                         <xf:label>
>                                                 Scottish Building  
> Regulations
>                                         </xf:label>
>                                         <xf:value>
>                                                 sbr
>                                         </xf:value>
>                                 </xf:item>
>                                 <xf:item>
>                                         <xf:label>
>                                                 Northern Ireland
> Building Regulations part F
>                                         </xf:label>
>                                         <xf:value>
>                                                 nibrf
>                                         </xf:value>
>                                 </xf:item>
>                         </xf:select1>
>                 </p>
>                 <p>
>                         <xf:select1 appearance='minimal' ref='stage'>
>                                 <!--should be disabled for purpose value  
> sbr
>                                 -->
>                                 <xf:label>
>                                         Stage of analysis
>                                 </xf:label>
>                                 <xf:item>
>                                         <xf:label>
>                                                 As built
>                                         </xf:label>
>                                         <xf:value>
>                                                 asbuilt
>                                         </xf:value>
>                                 </xf:item>
>                                 <xf:item>
>                                         <xf:label>
>                                                 As designed
>                                         </xf:label>
>                                         <xf:value>
>                                                 asdesigned
>                                         </xf:value>
>                                 </xf:item>
>                         </xf:select1>
>                 </p>
>                 <xf:submit submission='gi'>
>                 <xf:label>
>                 Save
>                 </xf:label>
>                 </xf:submit>
>         </body>
> </html>