A document has been updated: http://cocoon.zones.apache.org/daisy/documentation/743.html
Document ID: 743 Branch: main Language: default Name: Simple Binding (unchanged) Document Type: Document (unchanged) Updated on: 10/6/05 11:42:20 AM Updated by: Bruno Dumon A new version has been created, state: publish Parts ===== Content ------- This part has been updated. Mime type: text/xml (unchanged) File name: (unchanged) Size: 1656 bytes (previous version: 37 bytes) Content diff: --- <html><body><p>TODO</p></body></html> +++ <html> +++ <body> +++ +++ <h1>Concept</h1> +++ +++ <p>As an alternative for the more flexible <a href="daisy:488">binding +++ framework</a>, there is also a simpler solution when that can be used when there +++ is a 1-to-1 coupling between the XML and the form.</p> +++ +++ <p>The XML format is such that there is one XML element for each widget and the +++ element gets the widget id as name. Exceptions from this is that the elements in +++ a <a href="daisy:496">repeater</a> get the name "item" and an attribute +++ "position" with the position of the repeater child, instead of just a number +++ (which is not allowed as element name). Childs of a +++ <a href="daisy:490">MultiValueField</a> are also embeded within an "item" +++ element. If the Form widget does not have an id it get the name "unknown".</p> +++ +++ <p>An AggregateField can both be interpreted as one value and as several +++ widgets. This ambiguity is resolved by chosing to emit the single value rather +++ than the fields as XML. For population of the form both forms are however +++ allowed.</p> +++ +++ <h1>Usage</h1> +++ +++ <p>The simple XML binding is implemented by the following class:</p> +++ +++ <pre>org.apache.cocoon.forms.util.XMLAdapter +++ </pre> +++ +++ <p>To load XML, you simply construct an XMLAdapter with a form instance as +++ argument to the constructor. You can then load XML into the form simply by using +++ the XMLAdapter as a ContentHandler for the XML parser, and save the XML by using +++ the toSAX method on the XMLAdapter object.</p> +++ +++ <p>In the flowscript CForm API, the form object has a <tt>getXML()</tt> method +++ that returns an XMLAdapter instance. But more simply, there are also +++ <tt>form.loadXML(uri)</tt> and <tt>form.saveXML(uri)</tt> methods.</p> +++ +++ </body> +++ </html> Fields ====== no changes Links ===== no changes Custom Fields ============= no changes Collections =========== no changes
