cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ivelin Ivanov" <>
Subject Re: [Announcement] XMLForm 0.8.2 released
Date Thu, 23 May 2002 13:11:27 GMT


Very good observations.
I applied the patch immediately.

see below:
(Dmitri's feedback required)

----- Original Message -----
From: <>
To: <>; <>
Sent: Thursday, May 23, 2002 12:51 AM
Subject: Re: [Announcement] XMLForm 0.8.2 released

> Ivelin,
> >>> >>Report is supported. Report is simply a negation of assert.
> >>>
> >>> Just double checked this again.  Report doesn't work for me.  This
> >>>       <assert test="contains(not(.,'$'))">
> >>> but this doesn't:
> >>>       <report test="contains(.,'$')">
> >>I've tested it a bit but maybe there is a bug. Feel free to save XMLForm
> >>again :)
> >>The implementation is one line, so I can't immediately see where the
> >>might be.
> >>> ><assert >cannot contain <myns:name/> </assert>
> >>>
> >>> This would be *great* !! But unfortunately, doesn't work for me.
> >>it
> >>> might be because I my tags didn't have their own namespace so I tried:
> >>>       <assert test=".!=''">Please provide a <cnet:some_tag /></assert>
> >>> but the <some_tag> element just gets stripped out (by the validation
> >>> transformer?).
> >>Strange. Not intentional. Maybe another bug that waits to be busted.
> > I'll try to look into these problems this coming week...
> I dug into the code to see what was going on.  Here's what I found out...
> 1) <report> was definitely supported and definitely not working.  The
> was in the bindRules method of
> where you create the
> SchematronSchema object that gets processed by the Schematron Validator.
> call bindAsserts to add asserts to the SchematronSchema object, but never
> bindReports.
> So all that nice code you wrote for handling <report> never gets called.
Once I
> fixed this little "buglet" everything
> worked fine (and corrected spelling of "bindRerports" [sic] everything
> fine.  I have sent you a patched file...

Thank you. Valid patch. Applied.

> 2) The "elements inside <assert> getting stripped out" problem was more
> confusing. Here's how you appear to be getting the contents of <assert> or
> <report>:
>      String message = (String) jxpContext.getValue ( assertPrefix,
> );
>      report.setMessage( message );
> Since you are getting a *string* here I don't see how your code could
> handle elements.  Also, all of your "downstream" code for handling the
> assert/report "message" assumes type string, so AFAIK you would have to
> most of the Schematron Validator to support passing elements through to
the xslt
> processor.  Have I missed something?

You pinpointed the exact problem.
The gist of it is that getValue only returns the text value of the <report>
DOM node, but not its sub-elements.
Which is correct behaviour for JXPath.
The question for Dmitri is: How to get everything under <report> as a string
including sub-nodes and their attributes?

.getValue("node") for :
<node> some text <subnode> more text </subnode> final text </node>

correctly returns

"some text final text"

What we need though in this case is " some text <subnode> more text
</subnode> final text "

Dmitri, can you help here?

> 3) Incidentally, I think somebody *could* modify XMLForm to support
> <name/> and <value-of/> elements.  If I understand jxpath, you could get
> jxpContext for the appropriate view and then call getValue with the proper
> parameter.  The result would be a string which *could* be handled by the
> "downstream" code already in place.  Not high on my priority list: I need
> more than #3.  Any other takers?

Absolutely doable. Any takers ;)

Thanks for your support,


> Cheers,
> --Michael
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, email:

To unsubscribe, e-mail:
For additional commands, email:

View raw message