It is not the same transmission that was used on the 1997 model. Here is a link that tells you which Aisin transmission was used where:
Keep in mind that even if the housing was identical between say, 1994 and 97 LS, there are other things which may be different, and even the minutest difference would be enough to make this a no-go. In addition, they have different drive ratio in 1st gear.
As far as which Aisin transmission goes with which LS model, t boils down to this:
A341E - 1990-1994 LS
A340E - 1995-1997 LS
A650E - 1998-2000 LS