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. Advertisements

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. Ross M. Greenberg

    LAMP & J2EE as opposed to LAMP vs J2EE

    Ross M. Greenberg, Dec 12, 2004, in forum: Java
    Replies:
    6
    Views:
    1,810
    Robert kebernet Cooper
    Dec 24, 2004
  2. _z33
    Replies:
    0
    Views:
    472
  3. T.G.
    Replies:
    1
    Views:
    678
    Raymond DeCampo
    Jan 4, 2006
  4. Replies:
    1
    Views:
    548
  5. bugbear
    Replies:
    0
    Views:
    1,267
    bugbear
    Aug 28, 2003
  6. mehdi mousavi
    Replies:
    0
    Views:
    1,256
    mehdi mousavi
    Feb 15, 2009
  7. Jeffrey
    Replies:
    0
    Views:
    453
    Jeffrey
    Feb 28, 2009
  8. Jeffrey
    Replies:
    0
    Views:
    796
    Jeffrey
    Feb 28, 2009
Loading...