use "nillable" in schema file and xsi:nil="true" in xml file, but it is ignored by XForms extention



12 years ago
2 years ago


(Reporter: cjd0659, Unassigned)


Firefox Tracking Flags

(Not tracked)




12 years ago
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9a4pre) Gecko/20070411 Minefield/3.0a4pre
Build Identifier: firefox with xforms extention (I tried XForms 0.8 build 20070411 with minefield 3.0a4pre and the bug is there all the same)

hi everyone, 
I am a Mozilla fireforx XForms Extention & 0.8 user in China. 
Forgive my poor English.
I got a problem about "nillable" attribute in schema file for my XForms application.
smaug told me that I should raise this problem as a bug report.
I want to make an element which is "nillable"(in schema file) and 
add xsi:nil="true" in the xml file. What I mean is the element is an integer
or empty when displayed or edited. But the firefox browser told me that all
the null value of the element is invalid. I tried in X-smiles and formsplayer and
they all work as expected.

Reproducible: Always

Steps to Reproduce: the content below to a.xhtml:
      <title>XForms inputs with labels</title>
@namespace xforms url(;
.invalid, xforms|*:invalid { background-color: red; border-style: double;}
      <xf:model schema="a.xsd">
         <xf:instance id="default_ins">
          	<p1:Element-1 xmlns:p1="" xmlns:xsi="">
						    <p1:child1 xsi:nil="true"/>
         <xf:submission action="" method="post" id="submitOrder" ref="instance('default_ins')"/>
         <xf:input ref="instance('default_ins')/tr:child1" incremental="true">
            <xf:label>input child1's value: </xf:label>
          <xf:input ref="instance('default_ins')/tr:child2" incremental="true">
            <xf:label>input child2's value: </xf:label>
         <xf:submit submission="submitOrder">
</html> the content below to a.xsd:
<?xml version="1.0"?>
<xsd:schema xmlns:xsd="" 
        <xsd:element name="Element-1">
                    <xsd:element name="child1" type="xsd:integer" nillable="true"/>
                    <xsd:element name="child2" type="xsd:int"/>
</xsd:schema> a.xhtml with Firefox or Minefielda4pre, you will see the red 
background with child1's input, which meaning that the tag of <p1:child1 xsi:nil="true"/> is invalid. That's unexpected.
Actual Results:  
when a.xhtml opened by Firefox or Minefielda4pre, you will see the 
red background with child1's input, which meaning that the tag of <p1:child1 xsi:nil="true"/> is invalid.

Expected Results:  
when a.xhtml opened by Firefox or Minefielda4pre, you should see the 
white background with child1's input, which means that the tag of <p1:child1 xsi:nil="true"/> is valid. And when input any value, there should be a red background showing that the value violate the xsi:nil="true" tag.

From the a.xsd you can find that I want to get a /Element-1/child1 element which is nillable,
From the a.xhtml you can find that the instance "default_ins" which have the valid content:
<p1:Element-1 xmlns:p1="" xmlns:xsi="">
	<p1:child1 xsi:nil="true"/>

But when a.xhtml is displayed by firefox with xforms extention or Minefield(3.0a4pre) with XForms extention 0.8
the input box(child1) got a red background(by CSS) and users are not allowed to submit data to
I tried the the code in formsPlayer and xsmiles and they all worked as expected. 
What is expected is: when child1's input is empty, the background is white;
                     and when the child1's input got some value such as "1", it will got a red background and no action are performed when "submit" are clicked.
Is this a bug of Mozilla XForms or my misuse of "nillable"?
Appreciate for any reply from you!
RIP xforms
Last Resolved: 3 years ago
Resolution: --- → WONTFIX
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.