Return-Path: Delivered-To: apmail-ws-axis-dev-archive@www.apache.org Received: (qmail 55196 invoked from network); 10 Dec 2004 07:08:06 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 10 Dec 2004 07:08:05 -0000 Received: (qmail 69112 invoked by uid 500); 10 Dec 2004 07:07:59 -0000 Delivered-To: apmail-ws-axis-dev-archive@ws.apache.org Received: (qmail 69085 invoked by uid 500); 10 Dec 2004 07:07:58 -0000 Mailing-List: contact axis-dev-help@ws.apache.org; run by ezmlm Precedence: bulk Reply-To: axis-dev@ws.apache.org list-help: list-unsubscribe: list-post: Delivered-To: mailing list axis-dev@ws.apache.org Received: (qmail 69072 invoked by uid 99); 10 Dec 2004 07:07:58 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=RCVD_BY_IP,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: domain of ajith.ranabahu@gmail.com designates 64.233.184.203 as permitted sender) Received: from wproxy.gmail.com (HELO wproxy.gmail.com) (64.233.184.203) by apache.org (qpsmtpd/0.28) with ESMTP; Thu, 09 Dec 2004 23:07:58 -0800 Received: by wproxy.gmail.com with SMTP id 58so193539wri for ; Thu, 09 Dec 2004 23:07:55 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:references; b=DeZ7hrtN9nzfYoVAM/YGGGiM5QMkCLYyS6wMDXFK0Lqv5Lu/z+jVwRJ6AY567u/mP4bb+X5UKytrk69xUMx4E5RKWrPkBwxJPba4G0+zJjf+aHZAnLqWqx9h4BFDWw/ZWULjUautt7gB7zNmKMd2pKoeI/I4wbbnfQ1pNla0ONA= Received: by 10.54.46.57 with SMTP id t57mr567638wrt; Thu, 09 Dec 2004 23:07:55 -0800 (PST) Received: by 10.54.2.52 with HTTP; Thu, 9 Dec 2004 23:07:53 -0800 (PST) Message-ID: Date: Fri, 10 Dec 2004 13:07:53 +0600 From: Ajith Ranabahu Reply-To: Ajith Ranabahu To: axis-dev@ws.apache.org, chinthaka@opensource.lk Subject: Re: [Axis2][OM] Simpler way to get NameSpace In-Reply-To: <200412100451.iBA4plWO018716@relay2.slt.lk> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit References: <41B944CE.4010002@cs.indiana.edu> <200412100451.iBA4plWO018716@relay2.slt.lk> X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Hold on a sec! Why would anyone need to search the document for all the namespaces with a given prefix? I don't see any acceptable usecase where the USER needs to handle such complexities. As far as I am concerned the findnamespace method is concerned only with the current element ! is it not? (you cant have more than one namespace with a given prefix in that case) so that we should not provide a lot of alternatives through a single method. On Fri, 10 Dec 2004 12:55:56 +0600, Eran Chinthaka wrote: > > > > > >> > >>Srinath Perera wrote: > >> > >>>>So, let me try to summarize where we are now w.r.t. namespaces: > >>>> > >>>> interface OmNamespace { > >>>> public String getName (); // seems redundant to say > >>>>getNamespaceName! > >>>> public String getPrefix (); > >>>> } > >>>> > >>>> > >>>+1 > >>> > >>> > >>> > >>>>OMElement has the following: > >>>> > >>>> interface OmElement extends OmNode { > >>>> > >>>> > >>why does this have to extend OmNode? > >> > >>>> // declare a namespace at this element > >>>> public OmNamespace declareNamespace (String uri, String prefix); > >>>> > >>>> > >>also declareNamespace(OmNamespace) to allow reuse of namespace > >>declarations (perfectly fine and safe if OmNamespace is immutable) > >> > >>>> // find a namespace declaration here or from parent > >>>> public OmNamespace findNamespace (String uri, String prefix); > >>>> > >>>> > >>i guess: > >> > >>if prefix != null && uri != null find OmNamespace that has > >>OmNamespace.getPrefix() == prefix && OmNamespace.getName() == uri > >>if uri != null find OmNamespace that has OmNamespace.getName() == uri > >>if prefix != null find OmNamespace that has OmNamespace.getPrefix() == > >>prefix > >> > >>what happens for findNamespace(null, null) ?! > > [Chinthaka] I think having two methods is bit of a over doing. > We can do the samething using one method. > If u try to address the findNamespace(null, null) problem using two methods, > u r in trouble again, as what if findNamespaceByPrefix(null) or > findNamespaceByUri (null). > > I think its better to have one method like > OmNamespace findNamespace (String uri, String prefix); > If findNamespace(null,null), just throw an exception or return all. But if > we want to return all there should be another method like > Collection findNamespace (String uri, String prefix); > > And there is one other problem. > What if someone try to retrieve all the namespace which has some prefix. > > Say findNamespace(null,prefix). SO this should return a collection. Or else, > we document and say if there is more than one we just return the first one. > > Comments ??? > > Regards > -- Eran Chinthaka > > > > >> > >>maybe better is to have two functions? > >> > >> public OmNamespace findNamespaceByPrefix (String prefix); > >> public OmNamespace findNamespaceByUri (String uri); > >> > >> > >>>> // get my namespace name > >>>> public String getNamespaceName (); > >>>> > >>>> // get my local name > >>>> public String getLocalName (); > >>>> > >>>> .. > >>>> } > >>>> > >>>> > >>>+1 Think we are converging :) are we ? > >>> > >>> > >>looks good to me? > >> > >>-- > >>The best way to predict the future is to invent it - Alan Kay > >> > > -- Ajith Ranabahu