Using JAXP 1.3 with J2EE 1.3.1

Discussion in 'Java' started by Hugh McBride, Dec 21, 2004.

  1. Hugh McBride

    Hugh McBride Guest

    I am trying to use the new XInclude feature of JAXP 1.3 (unbundled)
    but
    I am restricted to J2EE 1.3.1 . I have already placed the dom.jar,
    sax.jar
    xalan.jar and xercesImple.jar in the <java_home>jre/lib/ext/ directory
    (using the endorsed directory is for JDK 1.4 . But the sample
    XInlcude demo
    included will not compile. What info I could find said not to add the
    jaxp-api.jar (Have tried it with and with out still doesnt work

    The main method of the of the class is below with
    the line causing the problem marked

    Any help/pointer would be greatly appreciated .
    Am using eclipse 3.0 as an editor and am sure there is no
    problem there

    public static void main(String argv[])
    {

    if (argv.length < 2)
    {
    printUsage();
    System.exit(1);
    }
    try
    {

    --> DocumentBuilderFactory dbf =
    DocumentBuilderFactory.newInstance();
    // make parser xinclude aware by setting the XIncludeAware
    to true.
    dbf.setXIncludeAware(true);
    dbf.setNamespaceAware(true);
    // parse the xml file.
    DocumentBuilder parser = dbf.newDocumentBuilder();
    parser.setErrorHandler(new ErrorHandlerImpl());
    Document doc = parser.parse(argv[0]);
    // write the output to specified file.
    DOMImplementation impl = doc.getImplementation();
    DOMImplementationLS implLS = (DOMImplementationLS)
    impl.getFeature("LS", "3.0");
    DOMErrorHandlerImpl eh = new DOMErrorHandlerImpl();
    Output out = new Output();

    LSSerializer writer = implLS.createLSSerializer();
    writer.getDomConfig().setParameter("error-handler", new
    DOMErrorHandlerImpl());
    out.setSystemId(argv[1]);
    writer.write(doc, out);
    System.out.println("//////// finished /////////");

    }
    catch (Exception ex)
    {
    System.out.println("Error occurred" + ex);
    }
    Hugh McBride, Dec 21, 2004
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. _z33
    Replies:
    0
    Views:
    408
  2. Replies:
    1
    Views:
    481
  3. bugbear
    Replies:
    0
    Views:
    1,000
    bugbear
    Aug 28, 2003
  4. Jeffrey
    Replies:
    0
    Views:
    326
    Jeffrey
    Feb 28, 2009
  5. Jeffrey
    Replies:
    0
    Views:
    669
    Jeffrey
    Feb 28, 2009
Loading...

Share This Page