<s:include b:url="{concat($bpc_controlpath, 'b-listview/b-listview.xml')}"/> <s:execute> <s:task b:action="show" /> </s:execute> <s:behavior b:name="row-delete"> <s:event b:on="command"> <s:task b:action="hide" b:target="../.."/> <s:task b:action="set" b:target="../../@b:changed" b:value="deleted"/> </s:event> </s:behavior> <s:behavior b:name="row-edit"> <s:event b:on="command"> <s:task b:action="set" b:target="../../@b:changed" b:value="edited"/> </s:event> </s:behavior> <s:behavior b:name="row-new"> <s:event b:on="command"> <s:task b:action="set" b:target="../../@b:changed" b:value="new"/> </s:event> </s:behavior> <s:behavior b:name="save-changes"> <s:event b:on="command"> <!-- Copying the changed rows and removing the editing controls from them. --> <s:task b:action="copy" b:source="id('filmdisplay')/tbody/tr[@b:changed]" b:destination="id('delta-bxml-container')/tbody" b:mode="aslastchild" /> <s:task b:action="remove" b:target="id('delta-bxml-container')/tbody/tr/td[last()]"/> <!-- Wrapping the changed filmdata in an XML document. --> <s:variable b:name="filmdata" b:select="id('delta-bxml-container')"/> <s:task b:action="bxml2string" b:variable="$filmdata"/> <s:task b:action="string2xml" b:variable="$filmdata"/> <!-- Loading the stylesheet and making an XML document out of it. --> <s:variable b:name="stylesheet"/> <s:task b:action="load" b:url="data/bxml2xml_standard.xsl" b:destination="$stylesheet"/> <s:task b:action="string2xml" b:variable="$stylesheet"/> <!-- Doing the transformation, putting the xml in a variable. --> <s:variable b:name="delta-xml"/> <s:task b:action="xsl-transform" b:stylesheet="$stylesheet" b:datasource="$filmdata" b:destination="$delta-xml"/> <!-- Sending the processed filmdata to the server and receiving the response. --> <s:variable b:name="response"/> <s:task b:action="load" b:method="POST" b:data="{concat('xmldata=',$delta-xml)}" b:destination="$response" b:url="save_xml.php"/> <!--s:task b:action="alert" b:value="{concat('transform result = ' , $delta-xml)}"/--> <!--s:task b:action="alert" b:value="{$response}"/--> <!-- Cleaning the local data so the changes cannot be saved twice. --> <s:task b:action="remove" b:target="id('delta-bxml-container')//tr"/> <s:task b:action="remove" b:target="id('filmdisplay')/tbody/tr[@b:changed='deleted']"/> <s:task b:action="remove" b:target="id('filmdisplay')/tbody/tr/@b:changed"/> </s:event> </s:behavior> <div style="margin:50px;"> <div style="width:650px; text-align:left; padding-bottom:20px;"> <h1>XML Databinding - Browser XSLT Engine</h1> In order to save the data in this example, PHP5 must be enabled on your server.<br/> Please note that this example is not expected to work in Internet Explorer 5.0 and 5.5. </div> <table id="delta-bxml-container" style="display:none;" xmlns="http://www.w3.org/1999/xhtml" xmlns:b="http://www.backbase.com/b" xmlns:s="http://www.backbase.com/s"><tbody></tbody></table> <div id="filmdisplay-container"> <s:execute> <!-- Loading and putting in XML format of filmdata. --> <s:variable b:name="filmdata"/> <s:task b:action="load" b:url="data/filmdata.xml" b:destination="$filmdata"/> <s:task b:action="string2xml" b:variable="$filmdata"/> <!-- Loading and putting in XML format of stylesheet. --> <s:variable b:name="stylesheet"/> <s:task b:action="load" b:url="data/xml2bxml_standard.xsl" b:destination="$stylesheet"/> <s:task b:action="string2xml" b:variable="$stylesheet"/> <!-- Transform and output the data, then sort the output table. --> <s:task b:action="xsl-transform" b:stylesheet="$stylesheet" b:datasource="$filmdata" b:destination="id('filmdisplay-container')"/> <s:task b:action="sort" b:target="id('filmdisplay')/thead/tr/th[1]" b:reverse="false"/> </s:execute> </div> <div style="width:650px; text-align:right; margin-bottom:2em;"> <b:button b:behavior="save-changes">Save Changes</b:button> </div> </div>