|
|
|
We need more infos to reproduce...
Feel free to reopen, if you can provide the requested infos. Adding the Separator between lines was introduced with the fix for
Deleting this has pros and cons. Pro, besides providing a workaround for the (weird!) parser issue, is that if you write a long regexp, with linebreaks for readability, the regexp will get messed up because of whitespaced mixed in. On the con side, if users write something like <![CDATA[ foo bar ]]> it will evaluate to one token (foobar), rather than two (which might be expected). I'm pretty unsure what is the right way here. Maybe we should make this configurable, so that users can decide? Maybe you will accept the way I solve it for myself. The problem is that we should accumulate all the characters between the opening and closing tag. So I have changed com.opensymphony.xwork.util.DomHelper.StartHandler class in the following way:
- added private StringBuffer instance variable (cb), - in startElement method cb variable is cleaned and then the invocation is forwarded to nextHandler, - in characters method - characters given as a parameter are accumulated in cb - characters method is NOT forwarded to nextHandler - in endElement method - if cb is not empty - nextHandler.characters method is invoked on the content in cb. The method nextHandler.endElement is anyway invoked after the conditional statement. Is it OK or you can think of cases this solution might fail? I just wanted to point out that the parser's behavior in splitting text into multiple nodes is not a bug. It is perfectly normal and allowed by the spec. Also, I don't think this issue should have been closed. The problems with both param and message text still exist in the head. The only sensible course here is to remove the extra space when concatenating multiple text nodes together in getTextValue. This will immediately fix the problem with param elements. To deal with message elements, we need to use the (modified) getTextValue method instead of getFirstChild on the messge nodes. Until that happens, validator xml is totally broken for me, and plenty of other folks too.
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
In the 2.02 branch I can not reproduce that RegexFieldValidator would fail on matching [a-zA-Z0-9_]* with abc.