logo       

Re: How to use org.apache.xerces.dom.DeferredDocumentImpl: msg#00059

Subject: Re: How to use org.apache.xerces.dom.DeferredDocumentImpl
Thanks James for your insight into the implementation.
Let me tell you the scenario. My source code 
System.setProperty(DOMImplementationRegistry.PROPERTY,
                "org.apache.xerces.dom.DocumentImpl");
         DOMImplementationRegistry registry = 
                DOMImplementationRegistry.newInstance();
         DOMImplementationLS impl = 
                (DOMImplementationLS)registry.getDOMImplementation("LS");
         LSParser builder = impl.createLSParser(
                DOMImplementationLS.MODE_SYNCHRONOUS, null);

         org.apache.xerces.dom.DeferredDocumentImpl document =
(org.apache.xerces.dom.DeferredDocumentImpl)builder.parseURI("personal.xml");

The above line of code gives me ClassCastException.
org.apache.xerces.dom.DeferredDocumentImpl extends
org.apache.xerces.dom.DocumentImpl so I tried to cast it to
org.apache.xerces.dom.DocumentImpl. The above code uses JDK1.5.

Is there any otherway to achieve the same with JDK1.4.2?

regards,
Ranjan

On Wed, 23 Feb 2005 13:39:02 +0000, James Shaw
<hertzsprrrung@xxxxxxxxxxxxxxx> wrote:
> Ranjan Baisak wrote:
> 
> >Hi,
> >    Can anybody give me any code example of usage of
> >org.apache.xerces.dom.DeferredDocumentImpl. I trying to cast
> >org.w3c.dom.Document to org.apache.xerces.dom.DeferredDocumentImpl but
> >it gives classcastexception though I am using Xerces parser.
> >Any help would be appreciated.
> >
> >
> >
> >
> The implementation class you get depends on what factory use are using
> to get a document, and the parameters you give to that factory. IIRC,
> Using JAXP's DocumentBuilder gives you a CoreDocumentImpl; using DOM
> Level 3 DOMImplementationRegistry to request a Load&Save
> DOMImplementation will give you a DeferredDocumentImpl (I think).
> 
> If you give some more context to your problem, I might be able to help
> you better :-)
> 
> James Shaw
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: xerces-j-user-unsubscribe@xxxxxxxxxxxxxx
> For additional commands, e-mail: xerces-j-user-help@xxxxxxxxxxxxxx
> 
>


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
boot-loaders.gr...    php.pear.genera...    debugging.valgr...    kde.redhat.user...    text.xml.xsl.ge...    culture.languag...    hardware.microc...    java.servicemix...    redhat.release....    web.zope.plone....    user-groups.lin...    opendarwin.webk...    video.mjpeg.use...    sysutils.bcfg2....    encryption.gpg....    lx-office.devel...    xfree86.forum/2...    mail.mutt.devel...    acpi.devel/2003...    qnx.openqnx.dev...    network.irc.irs...    freebsd.devel.m...   
Home | blog view | USPTO Patent Archive | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe