如何查找的总和和最大值中存在的字段?
<xhtml:html xmlns:xhtml="http://www.w3.org/1999/xhtml"
xmlns:odt="http://orbeon.org/oxf/xml/datatypes"
xmlns:xi="http://www.w3.org/2001/XInclude"
xmlns:sql="http://orbeon.org/oxf/xml/sql"
xmlns:xxi="http://orbeon.org/oxf/xml/xinclude"
xmlns:p="http://www.orbeon.com/oxf/pipeline"
xmlns:saxon="http://saxon.sf.net/"
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:oxf="http://www.orbeon.com/oxf/processors"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:xxforms="http://orbeon.org/oxf/xml/xforms"
xmlns:exforms="http://www.exforms.org/exf/1-0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:fr="http://orbeon.org/oxf/xml/form-runner"
xmlns:ev="http://www.w3.org/2001/xml-events"
xmlns:pipeline="java:org.orbeon.oxf.processor.pipeline.PipelineFunctionLibrary"
xmlns:f="http://orbeon.org/oxf/xml/formatting"
xmlns:xforms="http://www.w3.org/2002/xforms"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:exf="http://www.exforms.org/exf/1-0"
xmlns:date="http://exslt.org/dates-and-times">
<xhtml:head>
<xforms:model id="model">
<xforms:instance id="test">
<form xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<add>
<yes></yes>
</add>
</form>
</xforms:instance>
<xforms:instance id="duplicate-section">
<form>
<add>
<yes></yes>
</add>
</form>
</xforms:instance>
<xforms:bind id="yes" nodeset="instance('test')/add/yes" />
</xforms:model>
</xhtml:head>
<xhtml:body>
<table>
<tr>
<td>
<xforms:trigger incremental="true">
<xforms:label>Add</xforms:label>
<xforms:insert ev:event="DOMActivate" context="instance('test')" origin="instance('duplicate-section')/add"/>
</xforms:trigger>
</td>
</tr>
<xforms:repeat nodeset="instance('test')/add" id="add-repeat" startindex="1">
<tr>
<td><xforms:output ref="position()"/></td>
<td>
<fr:currency ref="yes" incremental="true">
</fr:currency>
</td>
</tr>
</xforms:repeat>
</table>
</xhtml:body>
</xhtml:html>
考虑到这一点,我单击“添加”按钮 5 次,并在 5 个文本框中输入值。我想找到这 5 个输入值的总和,并且我想找到这 5 个值的最大值。我怎样才能做到这一点?我只想显示总和和最大值。
<xhtml:html xmlns:xhtml="http://www.w3.org/1999/xhtml"
xmlns:odt="http://orbeon.org/oxf/xml/datatypes"
xmlns:xi="http://www.w3.org/2001/XInclude"
xmlns:sql="http://orbeon.org/oxf/xml/sql"
xmlns:xxi="http://orbeon.org/oxf/xml/xinclude"
xmlns:p="http://www.orbeon.com/oxf/pipeline"
xmlns:saxon="http://saxon.sf.net/"
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:oxf="http://www.orbeon.com/oxf/processors"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:xxforms="http://orbeon.org/oxf/xml/xforms"
xmlns:exforms="http://www.exforms.org/exf/1-0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:fr="http://orbeon.org/oxf/xml/form-runner"
xmlns:ev="http://www.w3.org/2001/xml-events"
xmlns:pipeline="java:org.orbeon.oxf.processor.pipeline.PipelineFunctionLibrary"
xmlns:f="http://orbeon.org/oxf/xml/formatting"
xmlns:xforms="http://www.w3.org/2002/xforms"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:exf="http://www.exforms.org/exf/1-0"
xmlns:date="http://exslt.org/dates-and-times">
<xhtml:head>
<xforms:model id="model">
<xforms:instance id="test">
<form xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<add>
<yes></yes>
</add>
</form>
</xforms:instance>
<xforms:instance id="duplicate-section">
<form>
<add>
<yes></yes>
</add>
</form>
</xforms:instance>
<xforms:bind id="yes" nodeset="instance('test')/add/yes" />
</xforms:model>
</xhtml:head>
<xhtml:body>
<table>
<tr>
<td>
<xforms:trigger incremental="true">
<xforms:label>Add</xforms:label>
<xforms:insert ev:event="DOMActivate" context="instance('test')" origin="instance('duplicate-section')/add"/>
</xforms:trigger>
</td>
</tr>
<xforms:repeat nodeset="instance('test')/add" id="add-repeat" startindex="1">
<tr>
<td><xforms:output ref="position()"/></td>
<td>
<fr:currency ref="yes" incremental="true">
</fr:currency>
</td>
</tr>
</xforms:repeat>
</table>
</xhtml:body>
</xhtml:html>
Consider that, I click add button 5 times and enter values in the 5 text boxes. I want to find the sum of these 5 values entered and also I would like to find the maximum value of these 5 values. How can I achieve this ? I just want to display the sum and the maximum value.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
对于 Sum,您可以输出此 xpath 表达式:
对于 Max,请使用:
For Sum you can output this xpath expression:
For Max, use this: