cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nadine Carlton" <>
Subject xspParser use and debugging
Date Tue, 05 Dec 2000 17:46:29 GMT

  I'm trying to use the xspParser to insert input into my document
from an xml input file.  I'm getting classnotfound exceptions when
I try to run it.  A sample of the code is below.  Does anyone
see what is wrong?  
Also, what is the best way to debug these
classnotfound errors?  I tried writing a java program that calls
the xsp processor, similar to the one I use for Xalan debugging,
but it is returning null pointer exceptions even on xml files using
xsp that work correctly.  So, I assume I haven't written that
correctly.  Is there a program to do this?  I've attached my
code that doesn't work.

Nadine Carlton

<?xml version="1.0" ?>
<?cocoon-process type="xsp"?>
<?cocoon-process type="xslt"?>
<?cocoon-format type="text/xml"?>

<Evue:OracleDataSource xmlns:evueODS="">

  <page title="SQL Search Results">

     String filename = request.getParameter("filename");
        if (filename != null) {
          String filepath = XSPUtil.relativeFilename(filename, request, (ServletContext) context);

          <h3 style="color:navy; text-align: center">
                new InputSource(
                  new FileReader(filepath)

     // The page will contain the dom tree.  

     Document doc = this.xspParser.getDocument();
     Element root = doc.getDocumentElement();

     Nodelist nodes = doc.getElementsByTagNameNS(NAMESPACE_URI,"primaryRole");

     if (nodes.getLength() > 0) {
        String primaryRole = nodes.item(0).getFirstChild().getNodeValue();




Simple xsp processor program that doesn't work, returning nullpointer
exceptions on valid xml files using xsp:

public class Simplexsp
 public static void main(String[] args)
    // result = new;

    XercesParser parser = new XercesParser();
    Document xspdoc = parser.parse(new XSLTInputSource("usecaseinput.xml"));
    // Hashtable parms= new Hashtable();
    // parms.put("request","");
    // parms.put("response","");

    XSPProcessor myxspprocessor = new XSPProcessor();

    Document result = myxspprocessor.process(xspdoc, null);

    System.out.println("Stylesheet output: " + result.toString());

View raw message