Hi, I am having an issue when I attempt to throw an error from a stylesheet, terminate, and then capture the error in a TransformerException in Java and extact it into a meaningful error message. I checked the mailing archive and it was suggested in 2002 that this functionality could be implemented:
http://marc.info/?l=xalan-j-users&m=103417059423384&w=2 I have tried the following with an older version of xalan and xerces, but also the latest (just downloaded xalan 2.7.1 and xerces 2.9.0) So here is my code. In my stylesheet I throw an error for whatever reason: <xsl:message terminate="yes">Error thrown</xsl:message> And in my Java code I attempt to catch and extact the error message: } catch (TransformerException e) { log.debug("Exception Caught during XSLT processing. Message: " + e.getMessage() + ", Location: " + e.getLocationAsString()); } The following line is printed out, but I don't know where from. I need to capture this information and log it: file:///C:/xxx/xxx.xsl; Line #171; Column #35; Error thrown None of the methods on the TransformerException object return this information. The only piece of information I get back regarding the error is returned from getMessage(): Stylesheet directed termination Am I doing anything wrong, or is what I am trying to do unachievable? Many thanks in advance, Stephen Stephen P Harper PTP Feeds Build GDP 228 5706 | Direct +44 141 228 5706 | Email [EMAIL PROTECTED] ----------------------------------------- This communication is for informational purposes only. It is not intended as an offer or solicitation for the purchase or sale of any financial instrument or as an official confirmation of any transaction. All market prices, data and other information are not warranted as to completeness or accuracy and are subject to change without notice. Any comments or statements made herein do not necessarily reflect those of JPMorgan Chase & Co., its subsidiaries and affiliates. This transmission may contain information that is privileged, confidential, legally privileged, and/or exempt from disclosure under applicable law. If you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution, or use of the information contained herein (including any reliance thereon) is STRICTLY PROHIBITED. Although this transmission and any attachments are believed to be free of any virus or other defect that might affect any computer system into which it is received and opened, it is the responsibility of the recipient to ensure that it is virus free and no responsibility is accepted by JPMorgan Chase & Co., its subsidiaries and affiliates, as applicable, for any loss or damage arising in any way from its use. If you received this transmission in error, please immediately contact the sender and destroy the material in its entirety, whether in electronic or hard copy format. Thank you. Please refer to http://www.jpmorgan.com/pages/disclosures for disclosures relating to UK legal entities.