mrglavas 2004/03/19 12:34:55 Modified: java/src/org/apache/xerces/dom DOMNormalizer.java Log: Fixing Bug #27792:
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=27792 DOMError.relatedData for the warning "cdata-sections-splitted" must be the first CDATASection node in document order resulting from the split. DOMNormalizer was reporting the second one. This is fixed thanks to the patch by Naela Nissar. Revision Changes Path 1.52 +7 -3 xml-xerces/java/src/org/apache/xerces/dom/DOMNormalizer.java Index: DOMNormalizer.java =================================================================== RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/dom/DOMNormalizer.java,v retrieving revision 1.51 retrieving revision 1.52 diff -u -r1.51 -r1.52 --- DOMNormalizer.java 15 Mar 2004 22:55:10 -0000 1.51 +++ DOMNormalizer.java 19 Mar 2004 20:34:55 -0000 1.52 @@ -468,10 +468,13 @@ if ((fConfiguration.features & DOMConfigurationImpl.SPLITCDATA) != 0) { int index; Node parent = node.getParentNode(); + isXMLCharWF(fErrorHandler, fError, fLocator, node.getNodeValue(), fDocument.isXML11Version()); while ( (index=value.indexOf("]]>")) >= 0 ) { node.setNodeValue(value.substring(0, index+2)); value = value.substring(index +2); + + Node firstSplitNode = node; Node newChild = fDocument.createCDATASection(value); parent.insertBefore(newChild, node.getNextSibling()); node = newChild; @@ -479,9 +482,9 @@ String msg = DOMMessageFormatter.formatMessage( DOMMessageFormatter.DOM_DOMAIN, "cdata-sections-splitted", - new Object[]{"Attr",node.getNodeName()}); + null); reportDOMError(fErrorHandler, fError, fLocator, msg, DOMError.SEVERITY_WARNING, - node, "cdata-sections-splitted"); + firstSplitNode, "cdata-sections-splitted"); } } @@ -1166,6 +1169,7 @@ error.fSeverity = severity; error.fLocator = locator; error.fType = type; + error.fRelatedData = node; locator.fRelatedNode = node; if(!errorHandler.handleError(error)) --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]