Gregory Blajian wrote:
I realize I could iterate through the all the fields but there is no way to determine if the entire document is valid or not valid with a single statement/call?
Gregory,
If I understand you correctly, you are asking two questions:
Q1) How to test in a single expression that everything is valid in the instance, instead of testing specifically on the "pin" element?
A1) With the XPath expression: not(//@xxforms:valid = 'false'). The updated enter-pin-action.xsl is attached.
Q2) How to prevent the message from being displayed when the user first comes to the page?
A2) One way to do this is to have a "constraint" XPath expression in the <xforms:bind> element that only checks the password when the form is submitted: <xforms:bind nodeset="/form/pin" constraint="/form/action = '' or . = '42'"/>.
Alex
<!--
Copyright (C) 2004 Orbeon, Inc.
This program is free software; you can redistribute it and/or modify it under the terms of the
GNU Lesser General Public License as published by the Free Software Foundation; either version
2.1 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU Lesser General Public License for more details.
The full text of the license is available at http://www.gnu.org/copyleft/lesser.html
-->
<valid xsl:version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xxforms="http://orbeon.org/oxf/xml/xforms">
<xsl:value-of select="not(//@xxforms:valid = 'false')"/>
</valid>
<!--
Copyright (C) 2004 Orbeon, Inc.
This program is free software; you can redistribute it and/or modify it under the terms of the
GNU Lesser General Public License as published by the Free Software Foundation; either version
2.1 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU Lesser General Public License for more details.
The full text of the license is available at http://www.gnu.org/copyleft/lesser.html
-->
<xforms:model xmlns:xforms="http://www.w3.org/2002/xforms"
xmlns:xxforms="http://orbeon.org/oxf/xml/xforms">
<xforms:instance>
<form>
<pin/>
<action/>
</form>
</xforms:instance>
<xforms:bind nodeset="/form/pin" constraint="/form/action = '' or . = '42'"/>
</xforms:model>
