473,473 Members | 2,178 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

DOM 3 with Xerces-J

I've been trying to use DOM level 3 with xerces-2_6_2. There's a
sample called samples/DOM3.java, but I've had trouble with
compilation. I've downloaded Xerces-J-bin.2.6.2 and
beta2-dom3-Xerces-J-bin.2.6 and added the following paths to my CLASSPATH:

..../xerces-2_6_2/xercesImpl.jar:
..../xerces-2_6_2/dom3-xercesImpl.jar:
..../xerces-2_6_2/dom3-xml-apis.jar:
..../xerces-2_6_2/xmlParserAPIs.jar:
..../xerces-2_6_2/xercesSamples.jar:
..../xerces-2_6_2/xml-apis.jar:
..../xerces-2_6_2/resolver.jar

When I compile dom/DOM3.java, I get 4 errors:

dom/DOM3.java:113: incompatible types
found : org.apache.xerces.dom3.DOMConfiguration
required: org.w3c.dom.DOMConfiguration
DOMConfiguration config = builder.getDomConfig();
^
dom/DOM3.java:144: cannot resolve symbol
symbol : method getDomConfig ()
location: interface org.w3c.dom.Document
config = doc.getDomConfig();
^
dom/DOM3.java:158: cannot resolve symbol
symbol : method normalizeDocument ()
location: interface org.w3c.dom.Document
doc.normalizeDocument();
^
dom/DOM3.java:165: incompatible types
found : org.apache.xerces.dom3.DOMConfiguration
required: org.w3c.dom.DOMConfiguration
config = domWriter.getDomConfig();
The first error occurs on a line that looks like:

DOMConfiguration config = builder.getDomConfig();

The error can be "fixed" in either of two ways:

org.apache.xerces.dom3.DOMConfiguration config =
builder.getDomConfig();

DOMConfiguration config =
(org.w3c.dom.DOMConfiguration)builder.getDomConfig ();

The fourth problem can also be "fixed" like this. The second and third
problems are however unclear to me. In case it makes any differnce,
I'm running java 1.4.1 under Solaris.

I'm generally uncertain whether I should be using DOM 3 in the first
place. The problem I'm working with involves extending an XML document
by picking out elements from several other XML files. If I'm extending
document A by looking in B, C and D,

I thought I would load A into a DOM tree and then use XPath to pick
out the various elenents of B, C and D that need to be added to A. To
do this, I need an environment where XPath and DOM can be used
together in a common framework. I need, e.g., to be able to evaluate
an XPath expression to get a NodeList that DOM can understand.

My first assumption was that I would use JAXP, and maybe this is the
right way to go. But I thought I might try DOM 3 Load and Save since:

1. It's the latest greatest technology.
2. It's supposed to be more general than JAXP.
3. It's cross platform (useful if I need to teach these things later
in a Perl course).

Maybe my assumptions are wrong, but this is what I understand from
what I have read. Any suggestions would be greatly appreciated.

Dale Gerdemann
Universitaet Tuebingen
Jul 20 '05 #1
0 1802

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Bekkali Hicham | last post by:
hi, i have downloaded the latest version 2.4 of Xerces, and unziped it, i end up with a diectory hierarchy like this c:\xerces-2_4_0\XercesImpl.jar c:\xerces-2_4_0\XercesSamples.jar...
1
by: Stu | last post by:
I am trying to build the xerces shared library with 2.3.0 version of their source code on an AIX 5.1 32 bit machine with the following version of the g++ compiler /usr/local/bin/g++ -v Reading...
0
by: Waseem | last post by:
Hi I have looked and tried everything and i still cant sort this out i have no idea why this wont work I am using Xerces Perl on Windows and Debian to try this and it wont work on both of...
0
by: Jim Phelps | last post by:
After having memory leak issues with Xerces-c 2.3.0 for Solaris 2.7 for CC 6.2 I have decided to update to at least 2.4. I have downloaded the binary tarball and have installed it on my...
18
by: jacksu | last post by:
I have a simple program to run xpath with xerces 1_2_7 XPathFactory factory = XPathFactory.newInstance(); XPath xPath = factory.newXPath(); XPathExpression xp = xPath.compile(strXpr);...
3
by: Matt | last post by:
Hello, Summary: Where can one download a Xerces-C (XML pardser) dynamic library file (.DLL file) for Windows (Win98/WinNT/Win2k/WinXP/Win2003, including server flavors; don't need to support...
2
by: Vlad Zorinov | last post by:
I'm getting the following error after a couple of months of XML processing, using Xerces 2.0.0 in an apache tomcat. Does anyone have any ideas what this problem may be or what I should do to solve...
3
by: Raphael Tagliani | last post by:
(english version below) Bonjour! Je travaille sur un gros projet java, qui parse beaucoup de fichiers xml au lancement d'un serveur. Nous avons un problème de concurrence qu lancement. En...
9
by: mstilli | last post by:
Hi, I am trying to use schema for server side validation using xerces to catch the validation errors. validating this XML: <Content4> <textarea13></textarea13>...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.