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 <pa...@hotmail.com> on 2000/09/20 07:49:59 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(XMLParserLiaisonDefault.java:1411)
at
org.apache.xalan.xpath.xml.XMLParserLiaisonDefault.getXLocatorFromNode(XMLParserLiaisonDefault.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
_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.
Share information about yourself, create your own public profile at
http://profiles.msn.com.