Return-Path: Delivered-To: apmail-geronimo-scm-archive@www.apache.org Received: (qmail 23277 invoked from network); 6 Mar 2007 00:14:39 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 6 Mar 2007 00:14:39 -0000 Received: (qmail 46241 invoked by uid 500); 6 Mar 2007 00:14:48 -0000 Delivered-To: apmail-geronimo-scm-archive@geronimo.apache.org Received: (qmail 46198 invoked by uid 500); 6 Mar 2007 00:14:47 -0000 Mailing-List: contact scm-help@geronimo.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: dev@geronimo.apache.org List-Id: Delivered-To: mailing list scm@geronimo.apache.org Received: (qmail 46187 invoked by uid 99); 6 Mar 2007 00:14:47 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 05 Mar 2007 16:14:47 -0800 X-ASF-Spam-Status: No, hits=-99.5 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 05 Mar 2007 16:14:37 -0800 Received: by eris.apache.org (Postfix, from userid 65534) id 79F331A9838; Mon, 5 Mar 2007 16:14:17 -0800 (PST) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r514932 - in /geronimo/server/branches/1.2: assemblies/geronimo-boilerplate-minimal/ modules/ modules/geronimo-xalan/ modules/geronimo-xalan/src/ modules/geronimo-xalan/src/main/ modules/geronimo-xalan/src/main/java/ modules/geronimo-xalan/... Date: Tue, 06 Mar 2007 00:14:16 -0000 To: scm@geronimo.apache.org From: djencks@apache.org X-Mailer: svnmailer-1.1.0 Message-Id: <20070306001417.79F331A9838@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: djencks Date: Mon Mar 5 16:14:15 2007 New Revision: 514932 URL: http://svn.apache.org/viewvc?view=rev&rev=514932 Log: GERONIMO-2933 make a non-jaxp-1.3 compliant hacked xalan 2.7 for the tck jaxp 1.2 tests Added: geronimo/server/branches/1.2/modules/geronimo-xalan/ geronimo/server/branches/1.2/modules/geronimo-xalan/LICENSE.txt (with props) geronimo/server/branches/1.2/modules/geronimo-xalan/NOTICE.txt (with props) geronimo/server/branches/1.2/modules/geronimo-xalan/pom.xml (with props) geronimo/server/branches/1.2/modules/geronimo-xalan/src/ geronimo/server/branches/1.2/modules/geronimo-xalan/src/main/ geronimo/server/branches/1.2/modules/geronimo-xalan/src/main/java/ geronimo/server/branches/1.2/modules/geronimo-xalan/src/main/java/org/ geronimo/server/branches/1.2/modules/geronimo-xalan/src/main/java/org/apache/ geronimo/server/branches/1.2/modules/geronimo-xalan/src/main/java/org/apache/xml/ geronimo/server/branches/1.2/modules/geronimo-xalan/src/main/java/org/apache/xml/utils/ geronimo/server/branches/1.2/modules/geronimo-xalan/src/main/java/org/apache/xml/utils/DefaultErrorHandler.java (with props) Modified: geronimo/server/branches/1.2/assemblies/geronimo-boilerplate-minimal/pom.xml geronimo/server/branches/1.2/modules/pom.xml Modified: geronimo/server/branches/1.2/assemblies/geronimo-boilerplate-minimal/pom.xml URL: http://svn.apache.org/viewvc/geronimo/server/branches/1.2/assemblies/geronimo-boilerplate-minimal/pom.xml?view=diff&rev=514932&r1=514931&r2=514932 ============================================================================== --- geronimo/server/branches/1.2/assemblies/geronimo-boilerplate-minimal/pom.xml (original) +++ geronimo/server/branches/1.2/assemblies/geronimo-boilerplate-minimal/pom.xml Mon Mar 5 16:14:15 2007 @@ -158,16 +158,22 @@ + + + + + - xalan - xalan + org.apache.geronimo.modules + geronimo-xalan + ${version} xerces xercesImpl - + xml-apis xml-apis Added: geronimo/server/branches/1.2/modules/geronimo-xalan/LICENSE.txt URL: http://svn.apache.org/viewvc/geronimo/server/branches/1.2/modules/geronimo-xalan/LICENSE.txt?view=auto&rev=514932 ============================================================================== --- geronimo/server/branches/1.2/modules/geronimo-xalan/LICENSE.txt (added) +++ geronimo/server/branches/1.2/modules/geronimo-xalan/LICENSE.txt Mon Mar 5 16:14:15 2007 @@ -0,0 +1,203 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + Propchange: geronimo/server/branches/1.2/modules/geronimo-xalan/LICENSE.txt ------------------------------------------------------------------------------ svn:eol-style = native Propchange: geronimo/server/branches/1.2/modules/geronimo-xalan/LICENSE.txt ------------------------------------------------------------------------------ svn:keywords = Date Revision Propchange: geronimo/server/branches/1.2/modules/geronimo-xalan/LICENSE.txt ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: geronimo/server/branches/1.2/modules/geronimo-xalan/NOTICE.txt URL: http://svn.apache.org/viewvc/geronimo/server/branches/1.2/modules/geronimo-xalan/NOTICE.txt?view=auto&rev=514932 ============================================================================== --- geronimo/server/branches/1.2/modules/geronimo-xalan/NOTICE.txt (added) +++ geronimo/server/branches/1.2/modules/geronimo-xalan/NOTICE.txt Mon Mar 5 16:14:15 2007 @@ -0,0 +1,6 @@ +Apache Geronimo +Copyright 2003-2006 The Apache Software Foundation + +This product includes software developed by +The Apache Software Foundation (http://www.apache.org/). + Propchange: geronimo/server/branches/1.2/modules/geronimo-xalan/NOTICE.txt ------------------------------------------------------------------------------ svn:eol-style = native Propchange: geronimo/server/branches/1.2/modules/geronimo-xalan/NOTICE.txt ------------------------------------------------------------------------------ svn:keywords = Date Revision Propchange: geronimo/server/branches/1.2/modules/geronimo-xalan/NOTICE.txt ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: geronimo/server/branches/1.2/modules/geronimo-xalan/pom.xml URL: http://svn.apache.org/viewvc/geronimo/server/branches/1.2/modules/geronimo-xalan/pom.xml?view=auto&rev=514932 ============================================================================== --- geronimo/server/branches/1.2/modules/geronimo-xalan/pom.xml (added) +++ geronimo/server/branches/1.2/modules/geronimo-xalan/pom.xml Mon Mar 5 16:14:15 2007 @@ -0,0 +1,79 @@ + + + + + + + + 4.0.0 + + + org.apache.geronimo.modules + modules + 1.2-SNAPSHOT + ../pom.xml + + + geronimo-xalan + Geronimo :: Xalan Hack + + + Geronimo Xalan replaces the jaxp 1.3 compliant DefaultErrorHandler present in xalan 2.7 with one that is not jaxp 1.3 compliant but passes the jaxp 1.2 tck + present in the j2ee 1.4 tck. + + + + + + xalan + xalan + + + + + + + + org.apache.maven.plugins + maven-dependency-plugin + + + unpack-real-xalan + generate-resources + + unpack + + + + + xalan + xalan + jar + + + ${project.build.directory}/classes + + + + + + + + + + Propchange: geronimo/server/branches/1.2/modules/geronimo-xalan/pom.xml ------------------------------------------------------------------------------ svn:eol-style = native Propchange: geronimo/server/branches/1.2/modules/geronimo-xalan/pom.xml ------------------------------------------------------------------------------ svn:keywords = Date Revision Propchange: geronimo/server/branches/1.2/modules/geronimo-xalan/pom.xml ------------------------------------------------------------------------------ svn:mime-type = text/xml Added: geronimo/server/branches/1.2/modules/geronimo-xalan/src/main/java/org/apache/xml/utils/DefaultErrorHandler.java URL: http://svn.apache.org/viewvc/geronimo/server/branches/1.2/modules/geronimo-xalan/src/main/java/org/apache/xml/utils/DefaultErrorHandler.java?view=auto&rev=514932 ============================================================================== --- geronimo/server/branches/1.2/modules/geronimo-xalan/src/main/java/org/apache/xml/utils/DefaultErrorHandler.java (added) +++ geronimo/server/branches/1.2/modules/geronimo-xalan/src/main/java/org/apache/xml/utils/DefaultErrorHandler.java Mon Mar 5 16:14:15 2007 @@ -0,0 +1,349 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/* + * $Id: DefaultErrorHandler.java 338167 2005-06-03 15:52:46Z mkwan $ + */ +package org.apache.xml.utils; + +import java.io.PrintStream; +import java.io.PrintWriter; + +import javax.xml.transform.ErrorListener; +import javax.xml.transform.SourceLocator; +import javax.xml.transform.TransformerException; + +import org.apache.xml.res.XMLErrorResources; +import org.apache.xml.res.XMLMessages; + +import org.xml.sax.ErrorHandler; +import org.xml.sax.SAXException; +import org.xml.sax.SAXParseException; + + +/** + * Implement SAX error handler for default reporting. + * This modifies the DefaultErrorHandler in xalan 2.7 to make it NOT JAXP 1.3 COMPLIANT + * To restore jaxp 1.3 behavior set the system property org.apache.geronimo.xalan.jaxp.13.compliant=true + * @xsl.usage general + */ +public class DefaultErrorHandler implements ErrorHandler, ErrorListener +{ + PrintWriter m_pw; + + /** + * if this flag is set to true, we will rethrow the exception on + * the error() and fatalError() methods. If it is false, the errors + * are reported to System.err. + */ + private static final boolean m_throwExceptionOnError; + + static { + boolean compliant = Boolean.getBoolean("org.apache.geronimo.xalan.jaxp.13.compliant"); + m_throwExceptionOnError = !compliant; + } + + /** + * Constructor DefaultErrorHandler + */ + public DefaultErrorHandler(PrintWriter pw) + { + m_pw = pw; + } + + /** + * Constructor DefaultErrorHandler + */ + public DefaultErrorHandler(PrintStream pw) + { + m_pw = new PrintWriter(pw, true); + } + + /** + * Constructor DefaultErrorHandler + */ + public DefaultErrorHandler() + { + this(true); + } + + /** + * Constructor DefaultErrorHandler + */ + public DefaultErrorHandler(boolean throwExceptionOnError) + { + m_pw = new PrintWriter(System.err, true); + //THIS MODIFIES THE NORMAL XALAN BEHAVIOR +// m_throwExceptionOnError = throwExceptionOnError; + } + + + /** + * Receive notification of a warning. + * + *

SAX parsers will use this method to report conditions that + * are not errors or fatal errors as defined by the XML 1.0 + * recommendation. The default behaviour is to take no action.

+ * + *

The SAX parser must continue to provide normal parsing events + * after invoking this method: it should still be possible for the + * application to process the document through to the end.

+ * + * @param exception The warning information encapsulated in a + * SAX parse exception. + * @throws SAXException Any SAX exception, possibly + * wrapping another exception. + */ + public void warning(SAXParseException exception) throws SAXException + { + printLocation(m_pw, exception); + m_pw.println("Parser warning: " + exception.getMessage()); + } + + /** + * Receive notification of a recoverable error. + * + *

This corresponds to the definition of "error" in section 1.2 + * of the W3C XML 1.0 Recommendation. For example, a validating + * parser would use this callback to report the violation of a + * validity constraint. The default behaviour is to take no + * action.

+ * + *

The SAX parser must continue to provide normal parsing events + * after invoking this method: it should still be possible for the + * application to process the document through to the end. If the + * application cannot do so, then the parser should report a fatal + * error even if the XML 1.0 recommendation does not require it to + * do so.

+ * + * @param exception The error information encapsulated in a + * SAX parse exception. + * @throws SAXException Any SAX exception, possibly + * wrapping another exception. + */ + public void error(SAXParseException exception) throws SAXException + { + //printLocation(exception); + // m_pw.println(exception.getMessage()); + + throw exception; + } + + /** + * Receive notification of a non-recoverable error. + * + *

This corresponds to the definition of "fatal error" in + * section 1.2 of the W3C XML 1.0 Recommendation. For example, a + * parser would use this callback to report the violation of a + * well-formedness constraint.

+ * + *

The application must assume that the document is unusable + * after the parser has invoked this method, and should continue + * (if at all) only for the sake of collecting addition error + * messages: in fact, SAX parsers are free to stop reporting any + * other events once this method has been invoked.

+ * + * @param exception The error information encapsulated in a + * SAX parse exception. + * @throws SAXException Any SAX exception, possibly + * wrapping another exception. + */ + public void fatalError(SAXParseException exception) throws SAXException + { + // printLocation(exception); + // m_pw.println(exception.getMessage()); + + throw exception; + } + + /** + * Receive notification of a warning. + * + *

SAX parsers will use this method to report conditions that + * are not errors or fatal errors as defined by the XML 1.0 + * recommendation. The default behaviour is to take no action.

+ * + *

The SAX parser must continue to provide normal parsing events + * after invoking this method: it should still be possible for the + * application to process the document through to the end.

+ * + * @param exception The warning information encapsulated in a + * SAX parse exception. + * @throws javax.xml.transform.TransformerException Any SAX exception, possibly + * wrapping another exception. + * @see javax.xml.transform.TransformerException + */ + public void warning(TransformerException exception) throws TransformerException + { + printLocation(m_pw, exception); + + m_pw.println(exception.getMessage()); + } + + /** + * Receive notification of a recoverable error. + * + *

This corresponds to the definition of "error" in section 1.2 + * of the W3C XML 1.0 Recommendation. For example, a validating + * parser would use this callback to report the violation of a + * validity constraint. The default behaviour is to take no + * action.

+ * + *

The SAX parser must continue to provide normal parsing events + * after invoking this method: it should still be possible for the + * application to process the document through to the end. If the + * application cannot do so, then the parser should report a fatal + * error even if the XML 1.0 recommendation does not require it to + * do so.

+ * + * @param exception The error information encapsulated in a + * SAX parse exception. + * @throws javax.xml.transform.TransformerException Any SAX exception, possibly + * wrapping another exception. + * @see javax.xml.transform.TransformerException + */ + public void error(TransformerException exception) throws TransformerException + { + // If the m_throwExceptionOnError flag is true, rethrow the exception. + // Otherwise report the error to System.err. + if (m_throwExceptionOnError) + throw exception; + else + { + printLocation(m_pw, exception); + m_pw.println(exception.getMessage()); + } + } + + /** + * Receive notification of a non-recoverable error. + * + *

This corresponds to the definition of "fatal error" in + * section 1.2 of the W3C XML 1.0 Recommendation. For example, a + * parser would use this callback to report the violation of a + * well-formedness constraint.

+ * + *

The application must assume that the document is unusable + * after the parser has invoked this method, and should continue + * (if at all) only for the sake of collecting addition error + * messages: in fact, SAX parsers are free to stop reporting any + * other events once this method has been invoked.

+ * + * @param exception The error information encapsulated in a + * SAX parse exception. + * @throws javax.xml.transform.TransformerException Any SAX exception, possibly + * wrapping another exception. + * @see javax.xml.transform.TransformerException + */ + public void fatalError(TransformerException exception) throws TransformerException + { + // If the m_throwExceptionOnError flag is true, rethrow the exception. + // Otherwise report the error to System.err. + if (m_throwExceptionOnError) + throw exception; + else + { + printLocation(m_pw, exception); + m_pw.println(exception.getMessage()); + } + } + + public static void ensureLocationSet(TransformerException exception) + { + // SourceLocator locator = exception.getLocator(); + SourceLocator locator = null; + Throwable cause = exception; + + // Try to find the locator closest to the cause. + do + { + if(cause instanceof SAXParseException) + { + locator = new SAXSourceLocator((SAXParseException)cause); + } + else if (cause instanceof TransformerException) + { + SourceLocator causeLocator = ((TransformerException)cause).getLocator(); + if(null != causeLocator) + locator = causeLocator; + } + + if(cause instanceof TransformerException) + cause = ((TransformerException)cause).getCause(); + else if(cause instanceof SAXException) + cause = ((SAXException)cause).getException(); + else + cause = null; + } + while(null != cause); + + exception.setLocator(locator); + } + + public static void printLocation(PrintStream pw, TransformerException exception) + { + printLocation(new PrintWriter(pw), exception); + } + + public static void printLocation(java.io.PrintStream pw, org.xml.sax.SAXParseException exception) + { + printLocation(new PrintWriter(pw), exception); + } + + public static void printLocation(PrintWriter pw, Throwable exception) + { + SourceLocator locator = null; + Throwable cause = exception; + + // Try to find the locator closest to the cause. + do + { + if(cause instanceof SAXParseException) + { + locator = new SAXSourceLocator((SAXParseException)cause); + } + else if (cause instanceof TransformerException) + { + SourceLocator causeLocator = ((TransformerException)cause).getLocator(); + if(null != causeLocator) + locator = causeLocator; + } + if(cause instanceof TransformerException) + cause = ((TransformerException)cause).getCause(); + else if(cause instanceof WrappedRuntimeException) + cause = ((WrappedRuntimeException)cause).getException(); + else if(cause instanceof SAXException) + cause = ((SAXException)cause).getException(); + else + cause = null; + } + while(null != cause); + + if(null != locator) + { + // m_pw.println("Parser fatal error: "+exception.getMessage()); + String id = (null != locator.getPublicId() ) + ? locator.getPublicId() + : (null != locator.getSystemId()) + ? locator.getSystemId() : XMLMessages.createXMLMessage(XMLErrorResources.ER_SYSTEMID_UNKNOWN, null); //"SystemId Unknown"; + + pw.print(id + "; " +XMLMessages.createXMLMessage("line", null) + locator.getLineNumber() + + "; " +XMLMessages.createXMLMessage("column", null) + locator.getColumnNumber()+"; "); + } + else + pw.print("("+XMLMessages.createXMLMessage(XMLErrorResources.ER_LOCATION_UNKNOWN, null)+")"); + } +} Propchange: geronimo/server/branches/1.2/modules/geronimo-xalan/src/main/java/org/apache/xml/utils/DefaultErrorHandler.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: geronimo/server/branches/1.2/modules/geronimo-xalan/src/main/java/org/apache/xml/utils/DefaultErrorHandler.java ------------------------------------------------------------------------------ svn:keywords = Date Revision Propchange: geronimo/server/branches/1.2/modules/geronimo-xalan/src/main/java/org/apache/xml/utils/DefaultErrorHandler.java ------------------------------------------------------------------------------ svn:mime-type = text/plain Modified: geronimo/server/branches/1.2/modules/pom.xml URL: http://svn.apache.org/viewvc/geronimo/server/branches/1.2/modules/pom.xml?view=diff&rev=514932&r1=514931&r2=514932 ============================================================================== --- geronimo/server/branches/1.2/modules/pom.xml (original) +++ geronimo/server/branches/1.2/modules/pom.xml Mon Mar 5 16:14:15 2007 @@ -97,6 +97,9 @@ geronimo-webservices geronimo-webservices-builder + + geronimo-xalan + geronimo-transformer geronimo-persistence-jpa10