You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by John Borchardt <jo...@megootz.com> on 2001/01/10 23:06:03 UTC
Xalan2.0D06 with Xerces/Tomcat4b1 Configuration Issues
After a good deal of trial and error, not to mention a little bit of Xalan
code modification (eeek!), I am able to get the ApplyXSLT sample Servlet to
work. Very nice when all is said on done! My question is, what is wrong
with my configuration that I had to go to the extremes I did to make this
sample work? It seems that rudundant classes in the classpath or
incompatible versions might be generating the hoops that I have jumped
through, but I can't seem to pinpoint the cause or a solution. A
description of my configuration and code modification is supplied below.
I'm hoping that it might lead to a more "correct" or graceful solution from
someone with a bit more knowledge than myself.
Any insights would be greatly appreciated!
Thanks,
John
*** Platform ***
Windows 2000 Professional SP1
Sun JDK 1.3.0_01
Tomcat4b1 installed with IIS
IE 5.5
Environment Classpath is empty prior to running startup.bat
*** Tomcat Configuration ***
- Create new WebApp named "xsl", the root of which contains an xml file and
an xsl file and the WEB-INF directory. The WEB-INF directory contains a
simple web.xml file with a servlet entry describing the servlet.ApplyXSLT
servlet and a classes directory. Finally, the classes directory contains a
servlet directory containing all of the files from Xalan's ApplyXSLT servlet
sample.
- I placed xalan.jar,xerces.jar, xalanservlet.jar, and xalansamples.jar in
the tomcat/lib directory so that they were accessible to the servlet.
- After starting tomcat, I addressed the servlet using a url of the form...
http://<systemname>:8080/xsl/servlet/ApplyXSLT?URL=/xsl/cd.xml&xslURL=/xsl/c
d.xsl&debug=true
- The server responded to my request with NoMethodSuchMethodErrors. Based
on the nature of the offending calls, I was able to simply comment them out
and move on to a functional configuration. However, something is obviously
just not right. The first error was in
org.apache.xpath.axes.ChildWalkerMultiStep.java Line 95
95 if (current.isSupported(FEATURE_NODETESTFILTER, "1.0"))
96 ((NodeTestFilter) current).setNodeTest(this);
The second was in org.apache.xpath.patterns.NodeTest.java Line 386
385 // Yuck! Blech! -sb
386 if(Node.TEXT_NODE == nodeType &&
!context.isSupported(SUPPORTS_PRE_STRIPPING, null))
387 {
388 Node parent = context.getParentNode();
389 if(null != parent && Node.ELEMENT_NODE == parent.getNodeType())
390 {
391 String data = context.getNodeValue();
392
if(org.apache.xml.utils.XMLCharacterRecognizer.isWhiteSpace(data))
393 {
394 // Ugly trick for now.
395 PrefixResolver resolver = xctxt.getNamespaceContext();
396 if(resolver instanceof WhitespaceStrippingElementMatcher)
397 {
398 WhitespaceStrippingElementMatcher wsem =
399 (WhitespaceStrippingElementMatcher)resolver;
400 if(wsem.shouldStripWhiteSpace(xctxt,
(org.w3c.dom.Element)parent))
401 {
402 return SCORE_NONE;
403 }
404 }
405 }
406 }
407 }