logo       

Re: getElementsByTagNameNS bug?: msg#00017

Subject: Re: getElementsByTagNameNS bug?
That can happen if the DOM was built with a non-namespace-aware parser, in 
which case each of the element nodes [1] will have a null local name. 
Calling namespace-aware methods on non-namespace-aware nodes (and vice 
versa) is a common usage error. If that's what you're doing, building the 
DOM with a namespace-aware parser (i.e. setting 
DocumentBuilderFactory.setNamespaceAware(true)) should fix your problem.

Thanks.

[1] 
http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/core.html#ID-2141741547

Michael Glavassevich
XML Parser Development
IBM Toronto Lab
E-mail: mrglavas@xxxxxxxxxx
E-mail: mrglavas@xxxxxxxxxx

"Jae Kwon" <jae@xxxxxxxxx> wrote on 05/12/2006 05:35:20 PM:

> 
> **** bug? ****
> 
> I have a Document object created by DocumentBuilder, whose
> (Element)parent.getElementsByTagNameNS(null, "*").item(0) returns an
> Element with name "Url" with namespaceURL of null. The NodeList only
> has this 1 element.
> 
> However the following statement returns null:
> (Element)parent.getElementsByTagNameNS(null, "Url").item(0)
> 
> as does the following. 
> (Element)parent.getElementsByTagNameNS("", "Url").item(0)
> (Element)parent.getElementsByTagNameNS("*", "Url").item(0)
> 
> 
> I am working with Java :
> java version "1.5.0_05"
> Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_05-b05)
> Java HotSpot(TM) Client VM (build 1.5.0_05-b05, mixed mode, sharing)
> 
> I am using Xerces version 2_7_1. (I have included this in my 
> classpath. Perhaps my JRE will override this, I'm not sure.).
> I know that the Element is a xerces Element. 
> 
> Is this in any way at all OK behavior or does this expose a bug in 
> xerces 2_7_1? 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: j-users-unsubscribe@xxxxxxxxxxxxxxxxx
> For additional commands, e-mail: j-users-help@xxxxxxxxxxxxxxxxx 


<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