[Xsltforms-support] Nill elements in XML result in failing validation
Brought to you by:
alain-couthures
|
From: Mark v. d. B. <ko...@gm...> - 2010-05-31 13:16:15
|
Nill elements in XML fail validation for some reason. See example below: <?xml-stylesheet href="xsltforms/xsltforms.xsl" type="text/xsl"?> <?xsltforms-options debug="yes"?> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:xf="http://www.w3.org/2002/xforms" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ev="http://www.w3.org/2001/xml-events" xml:lang="nl" lang="nl"> <head> <title>Test</title> <xf:model id="overzicht"> <xf:instance id="selectiescherm"> <root xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <date /> <date xsi:nil="true"></date> <date xsi:nil="true" /> <date></date> <date>2010-01-01</date> <bool /> <bool xsi:nil="true"></bool> <bool xsi:nil="true" /> <bool></bool> <bool>true</bool> <bool>false</bool> <number /> <number xsi:nil="true"></number> <number xsi:nil="true" /> <number></number> <number>1.23</number> </root> </xf:instance> <xf:bind nodeset="/root/date" type="xsd:date" /> <xf:bind nodeset="/root/bool" type="xsd:boolean" /> <xf:bind nodeset="/root/number" type="xsd:decimal" /> </xf:model> </head> <body> <hr /> <xf:repeat nodeset="/root/date"> <xf:input ref="."> <xf:label>Date</xf:label> </xf:input> <br/> </xf:repeat> <hr /> <xf:repeat nodeset="/root/bool"> <xf:input ref="."> <xf:label>Boolean</xf:label> </xf:input> <br/> </xf:repeat> <hr /> <xf:repeat nodeset="/root/number"> <xf:input ref="."> <xf:label>Number</xf:label> </xf:input> <br/> </xf:repeat> </body> </html> The code above will show all elements formatted with only the last one (with a valid value) of the sets not failing the validation. It would be nice if XSLTForms would support the xsi:nill attibute. Is this a bug or something else? Thx, Mark |