473,414 Members | 1,928 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,414 software developers and data experts.

XForms datatypes

-
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
xs:pattern 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 xmlns:xs="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>
Jul 20 '05 #1
1 1472
-
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
xs:pattern 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 xmlns:xs="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>

Jul 20 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Jonathan | last post by:
Does anyone know if it's possible to do the following: I currently have an XML schema set up, part of which includes an enumerated datatype (based on string) giving a list of values that I want...
2
by: Will | last post by:
I have been having problems validating an XForms document against the XForms schema located at http://www.w3.org/MarkUp/Forms/2002/XForms-Schema.xsd. I have reduced the XForm to its bare bones...
2
by: donaldevans_net | last post by:
I have a site that works well with others browsers. I'm getting complaints about IE5.2.3 that my layers are over lapping. I used XFORMS in my programming can you help me?
0
by: arti | last post by:
Hi all. I have a problem/question with XForms. I have 2 instnace in my document, instance1 and instance2. <xforms:instance xmlns="" id=instance1"> .... </xforms:instance> <xforms:instance...
9
by: jazzslider | last post by:
I have a headache. I've done a LOT of research lately into XForms, and I am thoroughly convinced that a good implementation of this technology would help me immensely in converting my...
7
by: ClarkePeters | last post by:
Can anyone tell me why my CSS style sheet isn't styling my xhtml (using xforms)? I'm using firefox 1.5.0.8 with the xforms extension. Here is the xhtml, it's only a single text area for input. ...
1
by: spark86 | last post by:
I currently have an xform where I'm trying to have the user input first and last name and then when it submits it goes to a file with the path first_last.xml. Here is what I have currently: ...
2
by: li72 | last post by:
Hi. I’m new to XForms society and struggling with a basic concepts. However, I’m trying to transform an xml doc into XForms using XSLT. The browser renders the Xforms just fine but there is no...
0
by: li72 | last post by:
As you can see in binding part, the node<age /> should be returned as a calendar or any form of date picker instead of an input box. In addition, none null values submission is not achieving. I...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.