Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > XML > XForms datatypes

Reply
Thread Tools

XForms datatypes

 
 
-
Guest
Posts: n/a
 
      07-02-2004
I am using XSmiles 0.91 to evaluate W3C XForms. Everything is the below
example is working OK, with the exception of the maxLength restriction
on the "email" control, which the browser seems to ignore. The alert
message is not displayed when "email" loses focus and the form submits.
This is not the required behaviour as I need to apply restrictions to
certain fields. Please note that the use of maxLength in this case is
simply an illustration, XSmiles ignores other restrictions such as
xsattern here too.

Can anyone explain where I am going wrong, or does XSmiles not support
restriction of datatypes via XML Schema yet?

Thanks

Will

(example follows

<head>

<xf:model>

<xs:schema xmlnss="http://www.w3.org/2001/XMLSchema">
<xs:simpleType name="emailaddress">
<xs:restriction base="xs:string">
<xs:maxLength value="1"/>
</xs:restriction>
</xs:simpleType>
</xs:schema>

<xf:instance>

<communication xmlns="http://example.info">
<name/>
<email/>
</communication>

</xf:instance>

<xf:bind nodeset="my:name" id="bindname" required="true()"/>
<xf:bind nodeset="my:email" id="bindemail" type="xs:emailaddress"/>

<xf:submission id="submit1" method="get" separator="&amp;"
action="http://abc.asp"/>

</xf:model>

</head>
<body>

<xf:input bind="bindname">
<xf:label>Name</xf:label>
<xf:alert>Please enter your name.</xf:alert>
</xf:input>

<xf:input bind="bindemail">
<xf:label>Email</xf:label>
<xf:alert>Please enter a valid email address.</xf:alert>
</xf:input>

</body>
 
Reply With Quote
 
 
 
 
-
Guest
Posts: n/a
 
      07-02-2004
Actually ignore that, I have realised there is a problem with the
schema. Just a bit rusty on XML Schema at the moment.

- wrote:
> I am using XSmiles 0.91 to evaluate W3C XForms. Everything is the below
> example is working OK, with the exception of the maxLength restriction
> on the "email" control, which the browser seems to ignore. The alert
> message is not displayed when "email" loses focus and the form submits.
> This is not the required behaviour as I need to apply restrictions to
> certain fields. Please note that the use of maxLength in this case is
> simply an illustration, XSmiles ignores other restrictions such as
> xsattern here too.
>
> Can anyone explain where I am going wrong, or does XSmiles not support
> restriction of datatypes via XML Schema yet?
>
> Thanks
>
> Will
>
> (example follows
>
> <head>
>
> <xf:model>
>
> <xs:schema xmlnss="http://www.w3.org/2001/XMLSchema">
> <xs:simpleType name="emailaddress">
> <xs:restriction base="xs:string">
> <xs:maxLength value="1"/>
> </xs:restriction>
> </xs:simpleType>
> </xs:schema>
>
> <xf:instance>
>
> <communication xmlns="http://example.info">
> <name/>
> <email/>
> </communication>
>
> </xf:instance>
>
> <xf:bind nodeset="my:name" id="bindname" required="true()"/>
> <xf:bind nodeset="my:email" id="bindemail" type="xs:emailaddress"/>
>
> <xf:submission id="submit1" method="get" separator="&amp;"
> action="http://abc.asp"/>
>
> </xf:model>
>
> </head>
> <body>
>
> <xf:input bind="bindname">
> <xf:label>Name</xf:label>
> <xf:alert>Please enter your name.</xf:alert>
> </xf:input>
>
> <xf:input bind="bindemail">
> <xf:label>Email</xf:label>
> <xf:alert>Please enter a valid email address.</xf:alert>
> </xf:input>
>
> </body>

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Difference between ASP.Net Forms and XForms Kiran ASP .Net 1 11-26-2004 01:34 PM
XFORMS Roedy Green Java 4 05-17-2004 07:18 PM
'select' element on XForms Jonathan XML 5 01-29-2004 12:49 PM
XForms and Schemas Jonathan XML 1 01-02-2004 03:28 PM
standalone xforms? (via swing or xul?) Herr Fuchs Java 2 10-17-2003 01:03 PM



Advertisments