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?



Title: RE: [xml-dev] Global or shared namespace?

Or:

try {
   if (elem.getNamespace().equals("http://javaWorstPractices.com/example") {
        doSomething();
   } else {
        doSomethingElse();
   }
}
catch (NullPointerException e) {
   doSomethingElse();
}
  

-----Original Message-----
From: Rob Decker [mailto:rdecker@quarterleaf.com]
Sent: 28 November 2001 22:06
To: xml-dev@lists.xml.org
Subject: 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>
>


-----------------------------------------------------------------
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>

The information transmitted by this e-mail message is intended solely for the use of the person to whom or entity to which it is addressed. The message may contain information that is privileged and confidential.  Disclosure, dissemination, distribution, review, retransmission to, other use of or taking any action in reliance upon this information by anyone other than the intended recipient is prohibited. If you are not the intended recipient, please do not disseminate, distribute or copy this communication, by e-mail or otherwise. Instead, please notify us immediately by return e-mail (including the original message with your reply) and then delete and discard all copies of the message.

Although we have taken precautions to minimize the risk of transmitting viruses we nevertheless advise you to carry out your own virus checks on any attachment to this message. We accept no liability for any loss or damage caused by viruses.