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

Home Posts Topics Members FAQ

Create DOM from SAX stream

I'm sorry if this has been incredibly overdone; I googled for a couple
minutes and couldn't come up with a definitive answer.

In my application I have the need to create a DOM from a stream of SAX
events. The way it currently works is that I instantiate an
org.apache.xml.utils.DOMBuilder on an empty org.w3c.dom.Document that
I've created from a JAXP DocumentBuilderFactory.

For the most part it works fine; all of the ContentHandler callbacks get
reported into the Document but only some of the LexicalHandler events
get reported.

Looking into the source for DOMBuilder I see that it tends to ignore
certain lexical events, mainly startDTD():

/**
* Report the start of DTD declarations, if any.
*
* Any declarations are assumed to be in the internal subset
* unless otherwise indicated.
*
* @param name The document type name.
* @param publicId The declared public identifier for the
* external DTD subset, or null if none was declared.
* @param systemId The declared system identifier for the
* external DTD subset, or null if none was declared.
* @see #endDTD
* @see #startEntity
*/
public void startDTD(String name, String publicId, String systemId)
throws org.xml.sax.SAXException
{

// Do nothing for now.
}
The DOMBuilder I'm using comes from the rt.jar under the 1.4.2_03 SDK.

I need these events to be fed back into the Document. Am I missing
something obvious here or will I need to extend the DOMBuilder and fill
in the gaps? Seems strange to me that would be left out.

Thanks for any help
Collin
Jul 20 '05 #1
0 1116

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

Similar topics

1
2261
by: Iwan | last post by:
I have a speciffic task of which i do not know how to start on. The task is to create a virtual drive (like a ram drive og deamon tools). Through this drive files are to be saved and loaded like...
4
10484
by: John Daly | last post by:
Does anyone know how to create an image (JPEG) from an HTTPResponse object? I am working on system that has a map pop up from our GIS department. I want create an image at runtime from this popup...
3
1350
by: markclinn | last post by:
I have a device in the field that I access by the stream method. I open the Stream and do the following: 1. stream.write a character to the device. 2. stream.read the information from the...
1
867
by: markclinn | last post by:
I have a device in the field that I access by the stream method. I open the Stream and do the following: 1. stream.write a character to the device. 2. stream.read the information from the device....
5
6846
by: Nitin Mahajan | last post by:
Guys Is there a way in C# to create a word object directly from a memory stream without passing that to hard disk (file stream). I think it doesn't makes sense to create a file just to read it...
0
7106
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
6967
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
7181
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
6846
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
4565
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3076
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3071
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1381
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 ...
1
600
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.