[Xsltforms-support] equality constraint
Brought to you by:
alain-couthures
|
From: Thorsten R. <ju...@sc...> - 2010-01-31 22:41:57
|
Hi
I'm trying to implement an equality constraint, but the resulting page
claims that the constraint is never fulfilled. See example below. What
am I doing wrong? BTW the XForms wikibook gives an equality constraint
example where "eq" is used instead of "=" and it says that this does not
work with xsltforms (indeed I get a parsing error). Don't know what is
correct. My example code follows.
Regards
Thorsten
<?xml-stylesheet href="xsltforms/xsltforms.xsl" type="text/xsl"?>
<?xsltforms-options debug="yes"?>
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:ev="http://www.w3.org/2001/xml-events"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:xf="http://www.w3.org/2002/xforms">
<head>
<title>Create account</title>
<xf:model>
<xf:instance xmlns="">
<person>
<password/>
<repeatPassword/>
</person>
</xf:instance>
<xf:bind nodeset="password" type="xs:string"
required="true()"/>
<xf:bind nodeset="repeatPassword" type="xs:string"
required="true()" constraint=". = password"/>
<xf:submission id="submit" method="post" action="echo.xql"
replace="all"/>
</xf:model>
<style>
fieldset {
width: 400px;
}
fieldset.NoLabel {
margin-top: 10px;
}
.xforms-label {
display: inline-block;
min-width:150px;
text-align: right;
margin-right: 20px;
}</style>
</head>
<body>
<fieldset xmlns="" class="Login">
<legend>Login</legend>
<xf:input ref="login">
<xf:label>Login:</xf:label>
</xf:input>
<xf:secret ref="password">
<xf:label>Password: </xf:label>
</xf:secret>
<xf:secret ref="repeatPassword">
<xf:label>Repeat Password: </xf:label>
</xf:secret>
</fieldset>
<xf:submit submission="submit">
<xf:label>Send</xf:label>
</xf:submit>
</body>
</html>
|