You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by Huey Lam <hl...@access360.com> on 2000/09/20 18:42:52 UTC

Processing DOM input with XSLTProcessor -- Help

Hello.... I need to get a XSLTProcessor that can process a DOM input and
i 
try the code below using both methods of getting a XSLTProcessor.  This
code 
is from the apache.org site - 
"http://xml.apache.org/xalan/usagepatterns.html#dom-in"  The code is in
a 
servlet and it compiles fine but keep getting an error (see below) when
i 
call this servlet responsible for processing the DOM.  Is there another
way?

I am using xalan_1_2_D01  with xerces-J1.1.3 running on NT4.0 with
weblogic 
5.1.

import org.apache.xerces.parsers.DOMParser;
import org.w3c.dom.Document;
import org.apache.xalan.xpath.xdom.XercesLiaison;
import org.apache.xalan.xslt.*;
...
// Just in case you want to produce your own DOM input...
DOMParser parser = new DOMParser();
parser.parse("My_XML_FILE");
Document in = parser.getDocument();
XSLTInputSource xmlID = new XSLTInputSource(in);
XSLTInputSource xslfile = new XLTInputSource
"my_xsl.xsl");

// Set up the XSLTProcessor to use XercesLiaison.
XSLTProcessor xsltProc = XSLTProcessorFactory.getProcessor
                 (new org.apache.xalan.xpath.xdom.XercesLiaison());
// or you can use XSLTProcessorFactory.getProcessorUsingLiaisonName
//("org.apache.xalan.xpath.xdom.XercesLiaison");
xsltProc.process(xmlID, xslfile, The_target);



THE ERROR STACKTRACE:

java.lang.NoSuchMethodError
        at 
org.apache.xalan.xpath.xdom.XercesLiaison.getParentOfNode(XercesLiaison.
java:396) 
at 
org.apache.xalan.xpath.xml.XMLParserLiaisonDefault.getRoot(XMLParserLiai
sonDefault.java:1411) 
at 
org.apache.xalan.xpath.xml.XMLParserLiaisonDefault.getXLocatorFromNode(X
MLParserLiaisonDefault.java:1994)
        at org.apache.xalan.xpath.XPath.locationPath(XPath.java:959)
        at org.apache.xalan.xpath.XPath.execute(XPath.java:1385)
        at org.apache.xalan.xpath.XPath.equals(XPath.java:586)
        at org.apache.xalan.xpath.XPath.execute(XPath.java:1358)
        at org.apache.xalan.xpath.XPath.predicate(XPath.java:981)
        at 
org.apache.xalan.xpath.SimpleNodeLocator.predicates(SimpleNodeLocator
.java:1437)..................


Am i missing anything?  Or this is a bug?  Please shed some light for
me.  
Thank you in advance!..........Huey


Huey Lam
Software Engineer II
Access360
Phone (949) 450-6417
Fax (949) 450-6500
www.access360.com

access360
A Better Way to Manage Access Rights