Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Using JAXP 1.3 with J2EE 1.3.1

Reply
Thread Tools

Using JAXP 1.3 with J2EE 1.3.1

 
 
Hugh McBride
Guest
Posts: n/a
 
      12-21-2004
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);
}
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
JAXP: Muenchian grouping using xsl:key broken in java 6 Jeffrey XML 0 02-28-2009 06:31 PM
JAXP: Muenchian grouping using xsl:key broken in java 6 Jeffrey Java 0 02-28-2009 06:23 PM
Schema validation using JAXP steve_marjoribanks@hotmail.com Java 1 02-20-2006 04:25 PM
retrieving namespace-uri using JAXP (DOM) _z33 Java 0 11-28-2005 09:52 AM
parsing XML to DOM, validating against a local DTD, using Xerces under JAXP? bugbear XML 0 08-28-2003 09:22 AM



Advertisments