Hello Mike,
I tried using DOMDocumentFactory, but while running it
seems to hang. Here is the code that I used -

        DocumentBuilderFactory factory =
DocumentBuilderFactory.newInstance();
        DocumentBuilder builder =
factory.newDocumentBuilder();

        org.w3c.dom.Document domDocument =
builder.parse( url );

        // now convert to DOM4J model
        DOMDocumentFactory fact =
(org.dom4j.dom.DOMDocumentFactory)DOMDocumentFactory.getInstance();
        DOMReader reader = new DOMReader(fact);
        Document document = reader.read(domDocument);

How did you want the DOMDocumentFactory to be used?

Sumitabh


--- Mike Skells <[EMAIL PROTECTED]>
wrote:
> Hi,
> I don't know the DTD problem/ID problem (or the w3c
> ID lookup for that
> matter), so I may be barking up the whong tree ...
> 
> Can you use the DOMDocumentFactory, then your nodes
> will be DOM4j and
> W3Cdom nodes, so the cast will not be a problem
> 
> If your document is readOnly - Can you attact an
> ElementHandler when you
> parse the document, and build up a map of
> ID->element for the lookup
> You could do the same with a visitor after the
> document has been read,
> or a custom document factory/element that maintains
> the Ids
> 
> Mike 
> 
> > -----Original Message-----
> > From: Kansal Sumitabh [mailto:[EMAIL PROTECTED]
> 
> > Sent: Thursday 27 March 2003 22:40
> > To: [EMAIL PROTECTED]
> > Subject: [dom4j-user] casting org.w3c.dom.Node to
> org.dom4j.Node
> > 
> > 
> > Hello,
> > 
> > I need fast ID lookup on my xml files, but my xml
> file
> > needs to use a DTD file. As I understand the dom4j
> > parser cannot do ID lookup properly if the xml
> file
> > uses a DTD, so am planning to use w3c's ID lookup
> as
> > it is much faster than the selectSingleNode(using
> > XPath for ID) - but now once I have
> org.w3c.dom.Node,
> > I cannot convert it into org.dom4j.Node
> > 
> > It keeps giving class cast exception. Any idea how
> to
> > do that?
> > 
> > Thanks,
> > Sumitabh
> > 
> > __________________________________________________
> > Do you Yahoo!?
> > Yahoo! Platinum - Watch CBS' NCAA March Madness,
> live on your 
> > desktop! http://platinum.yahoo.com
> > 
> > 
> >
>
-------------------------------------------------------
> > This SF.net email is sponsored by:
> > The Definitive IT and Networking Event. Be There!
> > NetWorld+Interop Las Vegas 2003 -- Register today!
> >
>
http://ads.sourceforge.net/cgi-bin/redirect.pl?keyn0001en
> > _______________________________________________
> > dom4j-user mailing list
> > [EMAIL PROTECTED] 
> > https://lists.sourceforge.net/lists/listinfo/d>
> om4j-user
> > 


__________________________________________________
Do you Yahoo!?
Yahoo! Platinum - Watch CBS' NCAA March Madness, live on your desktop!
http://platinum.yahoo.com


-------------------------------------------------------
This SF.net email is sponsored by:
The Definitive IT and Networking Event. Be There!
NetWorld+Interop Las Vegas 2003 -- Register today!
http://ads.sourceforge.net/cgi-bin/redirect.pl?keyn0001en
_______________________________________________
dom4j-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/dom4j-user

Reply via email to