DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT <http://nagoya.apache.org/bugzilla/show_bug.cgi?id=13216>. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND INSERTED IN THE BUG DATABASE.
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=13216 XMLFormTransformer violations tags don't match using canonical paths Summary: XMLFormTransformer violations tags don't match using canonical paths Product: Cocoon 2 Version: Current CVS Platform: All OS/Version: Other Status: NEW Severity: Major Priority: Other Component: general components AssignedTo: [EMAIL PROTECTED] ReportedBy: [EMAIL PROTECTED] If a complex data structure is used (e.g. HashMap) as part of the form data model, the violation JXPath to the offending elements will not match because XMLFormTransformer uses the reference path instead of the canonical path to compare (and violations report using canonical paths). Fixes for the startElementViolations() are below: else { Entry entry = (Entry) refStack.peek (); String currentRef = (String) entry.getValue (); Violation v = new Violation(); // Need to support getCanonicalPath on Form String canonicalPath = form.getCanonicalPath(currentRef); v.setPath( canonicalPath ); Collection restViolations = violations.tailSet ( v ); Iterator rviter = restViolations.iterator (); while ( rviter.hasNext () ) { Violation nextViolation = (Violation) rviter.next (); // we're only interested in violations // with matching reference // don't use currentRef rather use canonical path if ( !canonicalPath.equals (nextViolation.getPath () ) ) break; // render <violation> tag super.startElement(uri, TAG_VIOLATION, NS_PREFIX + ":" + TAG_VIOLATION, attributes ); // set message String vm = nextViolation.getMessage(); super.characters( vm.toCharArray(), 0, vm.length()); super.endElement(uri, TAG_VIOLATION, NS_PREFIX + ":" + TAG_VIOLATION); } --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]
