Using matches() in a bind

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

Using matches() in a bind

Stephanie Hall (TT)

Hi all,

 

I am hoping someone can point out what I am doing wrong here.  I have a few instances in my page, and on submit, I want to make sure that there are no invalid characters in the name node of one of the instances. However, if I enter “ef@#*$(#$“ the form will submit when it should not.

 

This is what I have currently:

 

<xforms:bind nodeset="instance('my-instance')/name" constraint="matches(instance('my-instance')/name,'^[0-9A-Za-z]+[0-9A-Za-z \._-]*$'" type="xs:string"/>

 

I’ve tested the regex by using a regexp validator so I don’t think that is the problem.  The instance node is only bound to a simple input, I just only want to accept non-special characters (aside from period, hyphen, underscore and space).

 

Any help is very much appreciated!

Thanks,

Stephanie

 



--
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
OW2 mailing lists service home page: http://www.ow2.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: Using matches() in a bind

Alessandro  Vernet
Administrator
Stephanie,

There is a closing parenthesis missing at the end of the XPath
expression. Adding it, with the small example I created here, I can
see the field being marked as invalid, as expected. If the problem is
not with the closing parenthesis, could you post a full (but simple)
example that runs in the XForms sandbox and reproduces this?

Alex

On Monday, January 4, 2010, Stephanie Hall (TT)
<[hidden email]> wrote:

>
>
>
>
>
>
>
>
>
>
>
>
>
> Hi all,
>
>
>
> I am hoping someone can point out what I am doing wrong
> here.  I have a few instances in my page, and on submit, I want to make
> sure that there are no invalid characters in the name node of one of the
> instances. However, if I enter “ef@#*$(#$“ the form will submit
> when it should not.
>
>
>
> This is what I have currently:
>
>
>
> <xforms:bind nodeset="instance('my-instance')/name"
> constraint="matches(instance('my-instance')/name,'^[0-9A-Za-z]+[0-9A-Za-z
> \._-]*$'" type="xs:string"/>
>
>
>
> I’ve
> tested the regex by using a regexp validator so I don’t think that is the
> problem.  The instance node is only bound to a simple input, I just only want
> to accept non-special characters (aside from period, hyphen, underscore and
> space).
>
>
>
> Any
> help is very much appreciated!
>
> Thanks,
>
> Stephanie
>
>
>
>
>
>
>
>
>
--
Orbeon Forms - Web forms, open-source, for the Enterprise
Orbeon's Blog: http://www.orbeon.com/blog/
My Twitter: http://twitter.com/avernet


--
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
OW2 mailing lists service home page: http://www.ow2.org/wws
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
Reply | Threaded
Open this post in threaded view
|

RE: Re: Using matches() in a bind

Stephanie Hall (TT)
Hi Alex,

Sorry about that.  The parenthesis wasn't missing from my xforms document, just when I pasted it here. It works in a standalone example but not in my main form, so I am trying to figure out what is going on. I don't think you guys will be able to help me with that, but thanks anyway!

Stephanie

-----Original Message-----
From: Alessandro Vernet [mailto:[hidden email]]
Sent: Monday, January 04, 2010 9:45 PM
To: [hidden email]
Subject: [ops-users] Re: Using matches() in a bind

Stephanie,

There is a closing parenthesis missing at the end of the XPath expression. Adding it, with the small example I created here, I can see the field being marked as invalid, as expected. If the problem is not with the closing parenthesis, could you post a full (but simple) example that runs in the XForms sandbox and reproduces this?

Alex

On Monday, January 4, 2010, Stephanie Hall (TT) <[hidden email]> wrote:

>
>
>
>
>
>
>
>
>
>
>
>
>
> Hi all,
>
>
>
> I am hoping someone can point out what I am doing wrong here.  I have
> a few instances in my page, and on submit, I want to make sure that
> there are no invalid characters in the name node of one of the
> instances. However, if I enter "ef@#*$(#$" the form will submit when
> it should not.
>
>
>
> This is what I have currently:
>
>
>
> <xforms:bind nodeset="instance('my-instance')/name"
> constraint="matches(instance('my-instance')/name,'^[0-9A-Za-z]+[0-9A-Z
> a-z
> \._-]*$'" type="xs:string"/>
>
>
>
> I've
> tested the regex by using a regexp validator so I don't think that is
> the problem.  The instance node is only bound to a simple input, I
> just only want to accept non-special characters (aside from period,
> hyphen, underscore and space).
>
>
>
> Any
> help is very much appreciated!
>
> Thanks,
>
> Stephanie
>
>
>
>
>
>
>
>
>
--
Orbeon Forms - Web forms, open-source, for the Enterprise Orbeon's Blog: http://www.orbeon.com/blog/ My Twitter: http://twitter.com/avernet


--
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
OW2 mailing lists service home page: http://www.ow2.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: RE: Re: Using matches() in a bind

Alessandro  Vernet
Administrator
Stephanie,

You managed to create a simpler example that works, and have a more  
complex version of that code that doesn't work. Looks like you've done  
the hard part; now you "just" need to figure out the gap! ;)

Alex



On Jan 5, 2010, at 12:04 PM, "Stephanie Hall (TT)" <[hidden email]
 > wrote:

> Hi Alex,
>
> Sorry about that.  The parenthesis wasn't missing from my xforms  
> document, just when I pasted it here. It works in a standalone  
> example but not in my main form, so I am trying to figure out what  
> is going on. I don't think you guys will be able to help me with  
> that, but thanks anyway!
>
> Stephanie
>
> -----Original Message-----
> From: Alessandro Vernet [mailto:[hidden email]]
> Sent: Monday, January 04, 2010 9:45 PM
> To: [hidden email]
> Subject: [ops-users] Re: Using matches() in a bind
>
> Stephanie,
>
> There is a closing parenthesis missing at the end of the XPath  
> expression. Adding it, with the small example I created here, I can  
> see the field being marked as invalid, as expected. If the problem  
> is not with the closing parenthesis, could you post a full (but  
> simple) example that runs in the XForms sandbox and reproduces this?
>
> Alex
>
> On Monday, January 4, 2010, Stephanie Hall (TT) <[hidden email]
> > wrote:
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> Hi all,
>>
>>
>>
>> I am hoping someone can point out what I am doing wrong here.  I have
>> a few instances in my page, and on submit, I want to make sure that
>> there are no invalid characters in the name node of one of the
>> instances. However, if I enter "ef@#*$(#$" the form will submit when
>> it should not.
>>
>>
>>
>> This is what I have currently:
>>
>>
>>
>> <xforms:bind nodeset="instance('my-instance')/name"
>> constraint="matches(instance('my-instance')/name,'^[0-9A-Za-z]
>> +[0-9A-Z
>> a-z
>> \._-]*$'" type="xs:string"/>
>>
>>
>>
>> I've
>> tested the regex by using a regexp validator so I don't think that is
>> the problem.  The instance node is only bound to a simple input, I
>> just only want to accept non-special characters (aside from period,
>> hyphen, underscore and space).
>>
>>
>>
>> Any
>> help is very much appreciated!
>>
>> Thanks,
>>
>> Stephanie
>>
>>
>>
>>
>>
>>
>>
>>
>>
>
> --
> Orbeon Forms - Web forms, open-source, for the Enterprise Orbeon's  
> Blog: http://www.orbeon.com/blog/ My Twitter: http://twitter.com/avernet
>
> --
> 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
> OW2 mailing lists service home page: http://www.ow2.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
OW2 mailing lists service home page: http://www.ow2.org/wws
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
Reply | Threaded
Open this post in threaded view
|

RE: Re: RE: Re: Using matches() in a bind

Stephanie Hall (TT)
So, just to double-check, if I have

<instance a>
<instance b>

<bind: nodeset:a constraint="..">
<bind: nodeset:b constraint="..">

<submission instance="instance a">

Both a and b will be evaluated for correctness before submission, right?  Even though instance b isn't being submitted to anything, it still will be checked?


-----Original Message-----
From: Alessandro Vernet [mailto:[hidden email]]
Sent: Tuesday, January 05, 2010 8:35 PM
To: [hidden email]
Subject: [ops-users] Re: RE: Re: Using matches() in a bind

Stephanie,

You managed to create a simpler example that works, and have a more complex version of that code that doesn't work. Looks like you've done the hard part; now you "just" need to figure out the gap! ;)

Alex



On Jan 5, 2010, at 12:04 PM, "Stephanie Hall (TT)" <[hidden email]
 > wrote:

> Hi Alex,
>
> Sorry about that.  The parenthesis wasn't missing from my xforms
> document, just when I pasted it here. It works in a standalone example
> but not in my main form, so I am trying to figure out what is going
> on. I don't think you guys will be able to help me with that, but
> thanks anyway!
>
> Stephanie
>
> -----Original Message-----
> From: Alessandro Vernet [mailto:[hidden email]]
> Sent: Monday, January 04, 2010 9:45 PM
> To: [hidden email]
> Subject: [ops-users] Re: Using matches() in a bind
>
> Stephanie,
>
> There is a closing parenthesis missing at the end of the XPath
> expression. Adding it, with the small example I created here, I can
> see the field being marked as invalid, as expected. If the problem is
> not with the closing parenthesis, could you post a full (but
> simple) example that runs in the XForms sandbox and reproduces this?
>
> Alex
>
> On Monday, January 4, 2010, Stephanie Hall (TT)
> <[hidden email]
> > wrote:
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> Hi all,
>>
>>
>>
>> I am hoping someone can point out what I am doing wrong here.  I have
>> a few instances in my page, and on submit, I want to make sure that
>> there are no invalid characters in the name node of one of the
>> instances. However, if I enter "ef@#*$(#$" the form will submit when
>> it should not.
>>
>>
>>
>> This is what I have currently:
>>
>>
>>
>> <xforms:bind nodeset="instance('my-instance')/name"
>> constraint="matches(instance('my-instance')/name,'^[0-9A-Za-z]
>> +[0-9A-Z
>> a-z
>> \._-]*$'" type="xs:string"/>
>>
>>
>>
>> I've
>> tested the regex by using a regexp validator so I don't think that is
>> the problem.  The instance node is only bound to a simple input, I
>> just only want to accept non-special characters (aside from period,
>> hyphen, underscore and space).
>>
>>
>>
>> Any
>> help is very much appreciated!
>>
>> Thanks,
>>
>> Stephanie
>>
>>
>>
>>
>>
>>
>>
>>
>>
>
> --
> Orbeon Forms - Web forms, open-source, for the Enterprise Orbeon's
> Blog: http://www.orbeon.com/blog/ My Twitter:
> http://twitter.com/avernet
>
> --
> 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
> OW2 mailing lists service home page: http://www.ow2.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
OW2 mailing lists service home page: http://www.ow2.org/wws
Reply | Threaded
Open this post in threaded view
|

RE: RE: Re: RE: Re: Using matches() in a bind

Stephanie Hall (TT)
Can any of the devs shed some light on this please?  From the tests I've run, only the instance that is referenced in the submission is validated upon submit.  Is this mentioned in the documentation anywhere?

-----Original Message-----
From: Stephanie Hall (TT) [mailto:[hidden email]]
Sent: Thursday, January 07, 2010 12:44 PM
To: [hidden email]
Subject: [ops-users] RE: Re: RE: Re: Using matches() in a bind

So, just to double-check, if I have

<instance a>
<instance b>

<bind: nodeset:a constraint="..">
<bind: nodeset:b constraint="..">

<submission instance="instance a">

Both a and b will be evaluated for correctness before submission, right?  Even though instance b isn't being submitted to anything, it still will be checked?


-----Original Message-----
From: Alessandro Vernet [mailto:[hidden email]]
Sent: Tuesday, January 05, 2010 8:35 PM
To: [hidden email]
Subject: [ops-users] Re: RE: Re: Using matches() in a bind

Stephanie,

You managed to create a simpler example that works, and have a more complex version of that code that doesn't work. Looks like you've done the hard part; now you "just" need to figure out the gap! ;)

Alex



On Jan 5, 2010, at 12:04 PM, "Stephanie Hall (TT)" <[hidden email]
 > wrote:

> Hi Alex,
>
> Sorry about that.  The parenthesis wasn't missing from my xforms
> document, just when I pasted it here. It works in a standalone example
> but not in my main form, so I am trying to figure out what is going
> on. I don't think you guys will be able to help me with that, but
> thanks anyway!
>
> Stephanie
>
> -----Original Message-----
> From: Alessandro Vernet [mailto:[hidden email]]
> Sent: Monday, January 04, 2010 9:45 PM
> To: [hidden email]
> Subject: [ops-users] Re: Using matches() in a bind
>
> Stephanie,
>
> There is a closing parenthesis missing at the end of the XPath
> expression. Adding it, with the small example I created here, I can
> see the field being marked as invalid, as expected. If the problem is
> not with the closing parenthesis, could you post a full (but
> simple) example that runs in the XForms sandbox and reproduces this?
>
> Alex
>
> On Monday, January 4, 2010, Stephanie Hall (TT)
> <[hidden email]
> > wrote:
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> Hi all,
>>
>>
>>
>> I am hoping someone can point out what I am doing wrong here.  I have
>> a few instances in my page, and on submit, I want to make sure that
>> there are no invalid characters in the name node of one of the
>> instances. However, if I enter "ef@#*$(#$" the form will submit when
>> it should not.
>>
>>
>>
>> This is what I have currently:
>>
>>
>>
>> <xforms:bind nodeset="instance('my-instance')/name"
>> constraint="matches(instance('my-instance')/name,'^[0-9A-Za-z]
>> +[0-9A-Z
>> a-z
>> \._-]*$'" type="xs:string"/>
>>
>>
>>
>> I've
>> tested the regex by using a regexp validator so I don't think that is
>> the problem.  The instance node is only bound to a simple input, I
>> just only want to accept non-special characters (aside from period,
>> hyphen, underscore and space).
>>
>>
>>
>> Any
>> help is very much appreciated!
>>
>> Thanks,
>>
>> Stephanie
>>
>>
>>
>>
>>
>>
>>
>>
>>
>
> --
> Orbeon Forms - Web forms, open-source, for the Enterprise Orbeon's
> Blog: http://www.orbeon.com/blog/ My Twitter:
> http://twitter.com/avernet
>
> --
> 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
> OW2 mailing lists service home page: http://www.ow2.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
OW2 mailing lists service home page: http://www.ow2.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: RE: RE: Re: RE: Re: Using matches() in a bind

Alessandro  Vernet
Administrator
Stephanie,

All the instances are "validated" but the submission won't go through  
only if the instance you are submitting is invalid. So like you say,  
there is no problem submitting instance A, if A is valid, and B is  
invalid. To be more precise, this is not even about the whole  
instance, but the part of the instance you are submitting. See the  
point 4 in section 11.2:

http://www.w3.org/TR/xforms11/#submit-evt-submit

Alex



On Jan 13, 2010, at 10:51 AM, "Stephanie Hall (TT)" <[hidden email]
 > wrote:

> Can any of the devs shed some light on this please?  From the tests  
> I've run, only the instance that is referenced in the submission is  
> validated upon submit.  Is this mentioned in the documentation  
> anywhere?
>
> -----Original Message-----
> From: Stephanie Hall (TT)  
> [mailto:[hidden email]]
> Sent: Thursday, January 07, 2010 12:44 PM
> To: [hidden email]
> Subject: [ops-users] RE: Re: RE: Re: Using matches() in a bind
>
> So, just to double-check, if I have
>
> <instance a>
> <instance b>
>
> <bind: nodeset:a constraint="..">
> <bind: nodeset:b constraint="..">
>
> <submission instance="instance a">
>
> Both a and b will be evaluated for correctness before submission,  
> right? Even though instance b isn't being submitted to anything, it  
> still will be checked?
>
>
> -----Original Message-----
> From: Alessandro Vernet [mailto:[hidden email]]
> Sent: Tuesday, January 05, 2010 8:35 PM
> To: [hidden email]
> Subject: [ops-users] Re: RE: Re: Using matches() in a bind
>
> Stephanie,
>
> You managed to create a simpler example that works, and have a more  
> complex version of that code that doesn't work. Looks like you've  
> done the hard part; now you "just" need to figure out the gap! ;)
>
> Alex
>
>
>
> On Jan 5, 2010, at 12:04 PM, "Stephanie Hall (TT)" <[hidden email]
>> wrote:
>
>> Hi Alex,
>>
>> Sorry about that.  The parenthesis wasn't missing from my xforms
>> document, just when I pasted it here. It works in a standalone  
>> example
>> but not in my main form, so I am trying to figure out what is going
>> on. I don't think you guys will be able to help me with that, but
>> thanks anyway!
>>
>> Stephanie
>>
>> -----Original Message-----
>> From: Alessandro Vernet [mailto:[hidden email]]
>> Sent: Monday, January 04, 2010 9:45 PM
>> To: [hidden email]
>> Subject: [ops-users] Re: Using matches() in a bind
>>
>> Stephanie,
>>
>> There is a closing parenthesis missing at the end of the XPath
>> expression. Adding it, with the small example I created here, I can
>> see the field being marked as invalid, as expected. If the problem is
>> not with the closing parenthesis, could you post a full (but
>> simple) example that runs in the XForms sandbox and reproduces this?
>>
>> Alex
>>
>> On Monday, January 4, 2010, Stephanie Hall (TT)
>> <[hidden email]
>>> wrote:
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> Hi all,
>>>
>>>
>>>
>>> I am hoping someone can point out what I am doing wrong here.  I  
>>> have
>>> a few instances in my page, and on submit, I want to make sure that
>>> there are no invalid characters in the name node of one of the
>>> instances. However, if I enter "ef@#*$(#$" the form will submit when
>>> it should not.
>>>
>>>
>>>
>>> This is what I have currently:
>>>
>>>
>>>
>>> <xforms:bind nodeset="instance('my-instance')/name"
>>> constraint="matches(instance('my-instance')/name,'^[0-9A-Za-z]
>>> +[0-9A-Z
>>> a-z
>>> \._-]*$'" type="xs:string"/>
>>>
>>>
>>>
>>> I've
>>> tested the regex by using a regexp validator so I don't think that  
>>> is
>>> the problem.  The instance node is only bound to a simple input, I
>>> just only want to accept non-special characters (aside from period,
>>> hyphen, underscore and space).
>>>
>>>
>>>
>>> Any
>>> help is very much appreciated!
>>>
>>> Thanks,
>>>
>>> Stephanie
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>
>> --
>> Orbeon Forms - Web forms, open-source, for the Enterprise Orbeon's
>> Blog: http://www.orbeon.com/blog/ My Twitter:
>> http://twitter.com/avernet
>>
>> --
>> 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
>> OW2 mailing lists service home page: http://www.ow2.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
> OW2 mailing lists service home page: http://www.ow2.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
OW2 mailing lists service home page: http://www.ow2.org/wws
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet