[Xsltforms-support] Unable to reference a selected element in inputs
Brought to you by:
alain-couthures
From: Peter O. <pol...@gm...> - 2010-03-24 01:54:54
|
I am trying to create an editor for an xml file that has a very specific format that has a series of <video>s, all with the same format. To do this I am using <select1> to choose which <video> to change, and then several <input>s that represent the fields within that <video>. I can't figure out how to get the <input>s to match the selected <video>. Here is the source: <?xml version="1.0" encoding="utf-8" ?> <?xml-stylesheet href="scripts/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:xs="http://www.w3.org/2001/XMLSchema"> <head> <title>Search</title> <xf:model id="control"> <xf:instance> <control xmlns=""> <current /> </control> </xf:instance> </xf:model> <xf:model id="document"> <xf:instance> <videos xmlns="http://www.example.org/videos" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.example.org/videos videos.xsd" id="videos"> <video name="Magnifica"> <description> <![CDATA[Don't be an arrogant jerk. Try Magnifica today!]]> </description> <furl>http://www.facebook.com/video/video.php?v=610610255477 </furl> <yurl>http://www.youtube.com/watch?v=X6--U2p7fnE </yurl> </video> <!-- more <video>s follow --> </videos> </xf:instance> </xf:model> </head> <body> <xf:input ref="video[2]@name" model="document"> <xf:label>name</xf:label> </xf:input> <!--other <input>s follow--> <xf:select1 model="control" ref="current"> <xf:label>Current Video:</xf:label> <xf:itemset model="document" nodeset="video"> <xf:label ref="@name" /> <xf:value ref="@name" /> </xf:itemset> </xf:select1> </body> </html> The xml that is being edited is the document <model>. According to the W3C specification, using <copy> instead of <value> inside the <itemset> and then referencing control/current should work, but I get an error (shown below). I am open to slight modifications in the formats if it will get the job done. XSLTForms Exception -------------------------- Error initializing : TypeError this.valueBinding is undefined |