Delis, Christopher E. wrote:
i'm not sure i understand your explanation.  are you suggesting that i need
to create another root container (e.g., /root) to hold the password and
password2 nodes in order to reference other form objects?  that doesn't seem
right.  or, are you saying that if change "/password" to "password" and
"/password2" to "password2" in my assert, that it should work (i tried this,
but it didn't work)?

Yes, I meant the second one. On what XML are these XPaths evaluated? Or is it JXPath on objects? Then I guess somebody else must help. Because I don't know the according XML structure for the objects.


You can try to write a mail to Ivelin (http://wiki.cocoondev.org/Wiki.jsp?page=IvelinIvanov), who is the XForms "guru". Or more general to the cocoon dev list.

Joerg

i could try creating another root to contain the password nodes, but then
i'd have to change the model (bean), too.  since my deadline for this
project isn't yesterday, i was hoping somebody out there has actually done
something similar to this in cocoon and was willing to share...  btw, i am
using cocoon 2.1 cvs snapshot (xml-cocoon-2.1-20030210233231.tar.gz).

TIA,

chris

-----Original Message-----
From: Joerg Heinicke [mailto:[EMAIL PROTECTED]

Hello Christopher,

I mentioned it already before: I guess the error are "/password" and "/password2" as the values of the context attributes of the rule element. I have never been using Schematron in Cocoon, but as I used it offline a stylesheet was created from this schematron XML description and the rule's contexts were used in the match attribute of <xsl:template/>. The problem is then, that you need two root elements, to get true out of your test. But that's not possible in XML. So I guessed that you must change "/password" to "password" (the same for "password2").

Regards,

Joerg


Delis, Christopher E. wrote:


i take it back! it still doesn't work =-(

i keep getting "Passwords do not match!" errors...



-----Original Message-----
From: Delis, Christopher E. [mailto:[EMAIL PROTECTED]

sheesh! turned out to be a stupid error on my part (i should've posted the
whole xml file and you probably would've found it right away). thanks for
helping! here's what works:


<?xml version="1.0" ?>
<schema ns="http://xml.apache.cocoon/xmlform";
xmlns="http://www.ascc.net/xml/schematron";>
<title>Schema for the Password Form</title>
<phase id="passwordView">
<p>For password information.</p>
<active pattern="password"/>
</phase>
<pattern name="Password Validation Pattern" id="password">
<rule context="/password">
<assert test="string-length(.) &gt; 3">Password
should be at least 4 characters.</assert>
<assert test="string-length(.) &lt; 60">Password
should be less
than 60 characters.</assert>
<assert
test="string(.)=string(../password2)">Passwords do not

match!</assert>


</rule>
<rule context="/password2">
<assert test="string-length(.) &gt; 3">Password
should be at least 4 characters.</assert>
</rule>
</pattern>
</schema>


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to