[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Usage of SourceLocator in TransformerException

Subject: Usage of SourceLocator in TransformerException
From: Ellango Rajagopalan <rellango@xxxxxxxxx>
Date: Mon, 30 Jul 2001 14:15:57 -0700 (PDT)
sourcelocator
Hi All:

I am transforming an XML file using an XSL file with
the code as below.

Document xmlDocument = dBuilder.parse(new
FileInputStream(xmlFile));
DOMSource domSource = new DOMSource(xmlDocument);
Transformer transformer = tFactory.newTransformer(new
StreamSource(new FileInputStream(xslFileName)));
try {
  transformer.transform(domSource, new StreamResult 
(outputFileName));
} catch (TransformerException tex) {
  System.out.println("TransformerException caught. " +
tex.getMessage());
}

The xslfile uses Xalan-Java extensions and calls a
method as below:

public String someMethod() throws TransformerException
{
   try {
        // some code
   } catch (Exception ex) {
     	throw new TransformerException(ex.getMessage (),
sourceLocator);
   }
}

My problem is in the usage of the SourceLocator in the
constructor
of the TransformerException. 
- How do I associate the SourceLocator to my XML file?
- I am using DOM, so I guess I need to use DOMLocator.
Both SourceLocator and DOMLocator are interfaces.
I am using Xalan-Java 2.0.0. The API document says
that
All Known Implementing Classes:
ElemTemplateElement, SAXSourceLocator.
These classes do not seem to be what I need. 
In any case, I still do not know how to construct and
associate an implementing class of this interface with
my xml, so that I can get debugging data from
exceptions.

Any help would be great.

Thanks.

Ellango

__________________________________________________
Do You Yahoo!?
Make international calls for as low as $.04/minute with Yahoo! Messenger
http://phonecard.yahoo.com/

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.