Thread: [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 |
From: Alain C. <ala...@ag...> - 2011-07-20 18:46:07
|
Hello Thorsten, I have been testing with XSLTForms r508 on Windows with FireFox 6.0 Beta and Chrome latest release and I didn't see a problem... First, it would be better to add xmlns="" at your instance. Could you please check with a Javascript debugger that you get the following line in the second script element within the head element? new XFInstance("xf-instance-0",xf_model_0,false,"application/xml",null,'<CMD xmlns="http://www.w3.org/1999/xhtml" someattribute="somevalue"><ResourceName>My Tool</ResourceName></CMD>'); or, better, new XFInstance("xf-instance-0",xf_model_0,false,"application/xml",null,'<CMD xmlns="" someattribute="somevalue"><ResourceName>My Tool</ResourceName></CMD>'); Thanks! -Alain Le 20/07/2011 11:23, Thorsten Trippel a écrit : > 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 > > > ------------------------------------------------------------------------------ > 10 Tips for Better Web Security > Learn 10 ways to better secure your business today. Topics covered include: > Web security, SSL, hacker attacks& Denial of Service (DoS), private keys, > security Microsoft Exchange, secure Instant Messaging, and much more. > http://www.accelacomm.com/jaw/sfnl/114/51426210/ > _______________________________________________ > Xsltforms-support mailing list > Xsl...@li... > https://lists.sourceforge.net/lists/listinfo/xsltforms-support > |