OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [xml-dev] Global or shared namespace?



How about:

if
(StuffIDoAllTheTime.compareIfSomething(e1.getNamespace(),e2.getNamespace()))

static boolean compareIfSomething(Object o1, Object o2)
{
    return (something(o1) && something(o2)) ? o1.equals(o2) : false;
}

static boolean something(Object o)
{
    if (o1 == null)
        return false;
    if (o1 instanceof Boolean)
        return ((Boolean)o1).booleanValue();
    if (o1.toString().trim().length())
        return false;
}
----- Original Message -----
From: "Tom Bradford" <bradford@dbxmlgroup.com>
To: "Bob Hutchison" <hutch@xampl.com>
Cc: <xml-dev@lists.xml.org>
Sent: Wednesday, November 28, 2001 3:43 PM
Subject: Re: [xml-dev] Global or shared namespace?


> Bob Hutchison wrote:
> >
> > At the risk of being pedantic, rude, etc.
> >
> >     if ("http://my.namespace.com/".equals(elObject.getNamespace()))
> >
> > works with getNamespace() returning a null.
> >
> > Sorry :-)
>
> Oh yeah?
>
>    if ( thisElem.getNamespace().equals(thatElem.getNamespace()) )
>
> Put that in your pipe and smoke it! :)  You must be one of those people
> who write stuff like:
>
>    if ( 55 == speed ) ...
>
> How dare you, sir!
>
> -- Tom
>
> -----------------------------------------------------------------
> The xml-dev list is sponsored by XML.org <http://www.xml.org>, an
> initiative of OASIS <http://www.oasis-open.org>
>
> The list archives are at http://lists.xml.org/archives/xml-dev/
>
> To subscribe or unsubscribe from this list use the subscription
> manager: <http://lists.xml.org/ob/adm.pl>
>