TransformerException, getting the source

Discussion in 'Java' started by dado0583@hotmail.com, Mar 1, 2005.

  1. Guest

    Hi, I'm building an XSLT editor, and it does XSLT transformations using
    the javax.xml.transform library. When there is a problem with the
    stylesheet, e.g. a missing tag, or an element not having a required
    attribute, it throws a TransformerException.
    I want to get the line number of the source of the problem to give
    back to the user so they can find where they are going wrong. I get the
    SourceLocator object from the TransformerException, however, it is
    always null and therefore I can't get the line number of the problem?

    Can anyone give me any insights?

    public void alertError(TransformerException e){
    SourceLocator sl = e.getLocator();
    //sl is always null!
    }
     
    , Mar 1, 2005
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. ~~~ .NET Ed ~~~
    Replies:
    1
    Views:
    4,225
    Cowboy \(Gregory A. Beamer\)
    Feb 26, 2005
  2. veny
    Replies:
    0
    Views:
    563
  3. Marcus Leon
    Replies:
    5
    Views:
    611
    Marcus Leon
    Feb 3, 2005
  4. Robert Kattke
    Replies:
    2
    Views:
    4,959
    Robert Kattke
    Apr 21, 2004
  5. Abdelhalim
    Replies:
    2
    Views:
    1,104
    Tom Hawtin
    Jul 6, 2007
Loading...

Share This Page