[Xsltforms-support] Data models containing attributes, problem: no display
Brought to you by:
alain-couthures
From: Thorsten T. <tho...@un...> - 2011-07-20 09:23:21
|
Hi, first of all: XSLTForms is great fun to work with. Thanks for providing it. Some extremely awkward behavior can be experienced if my data models contain attributes: the content of the forms will not show for these subtrees, nor the input fields. I am using XSLTForms Beta 3 r508, tested with Firefox 5.01 and Chrome 12.0.742.122 on Mac OS X (Snow Leopard), tested with Apache access (XAMPP) and file access. Extremely simplified example (does not work, attribute at CMD element at the model, output and input will not display): <?xml version="1.0" encoding="UTF-8"?> <?xml-stylesheet href="xsltforms/xsltforms.xsl" type="text/xsl"?> <?xsltforms-options debug="yes"?> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xf="http://www.w3.org/2002/xforms" xmlns:ev="http://www.w3.org/2001/xml-events" xmlns:xml="http://www.w3.org/XML/1998/namespace"> <head> <title>Some title</title> <xf:model> <xf:instance> <CMD someattribute="somevalue"> <ResourceName>My Tool</ResourceName> </CMD> </xf:instance> </xf:model> </head> <body> <h1>ResourceName: <xf:output ref="/CMD/ResourceName"></xf:output></h1> <xf:input ref="/CMD/ResourceName"> <xf:label>ResourceName</xf:label> </xf:input> </body> </html> Extremely simplified example (Does work, no attribute at CMD element in the model): <?xml version="1.0" encoding="UTF-8"?> <?xml-stylesheet href="xsltforms/xsltforms.xsl" type="text/xsl"?> <?xsltforms-options debug="yes"?> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xf="http://www.w3.org/2002/xforms" xmlns:ev="http://www.w3.org/2001/xml-events" xmlns:xml="http://www.w3.org/XML/1998/namespace"> <head> <title>Some title</title> <xf:model> <xf:instance> <CMD> <ResourceName>My Tool</ResourceName> </CMD> </xf:instance> </xf:model> </head> <body> <h1>ResourceName: <xf:output ref="/CMD/ResourceName"></xf:output></h1> <xf:input ref="/CMD/ResourceName"> <xf:label>ResourceName</xf:label> </xf:input> </body> </html> This behavior is reproducible, also for "exotic" attributes such as xml:lang or xmlns="...", etc. As my data model is not fully under my control (and I certainly cannot get rid of attributes in general) I wonder if anybody experienced something similar or if there is a way around that. Thorsten |