[MOBY-dev] Prefixes for generated moby objects

Martin Senger martin.senger at gmail.com
Fri Apr 7 15:02:01 UTC 2006


Hi,

> By executing my BioMoby service I found, that some tags (XML namespaces) in 
> the output XML file were prefixed with "moby:" and all JMoby primitives were 
> not.
> 
> Because of that I've got some problems by parsing the XML output with Java 
> JDOM.
> So my questions are:
> 
> Why have the primitives no "moby" XML namespace?
> Is it possible to change the JMoby api so that all primitives get a "moby" XML 
> namespace too?
>
     I had similar problems. When I was using JDOM I was always asked 
two questions: first using a local name, second with the moby namespace. 
I have even added two methods in (jMoby) org.biomoby.shared.Utils:


      * Get a child by 'name' from 'parent'. It tries first a child
      * without any namespace, then with {@link #MOBY_NS}. <p>
      *
     public static Element getChild (Element parent, String name);

      * Get text of a child 'name' from 'parent'. It tries first a
      * child without any namespace, then with {@link #MOBY_NS}. <p>
      *
     public static String getChildText (Element parent, String name);

    But I wonder if this is a correct way to do it. Anybody (perhaps 
Paul?) knows more about how to treat namespaces?
    Also, (Mark, Eddie?) what is in the Moby API about namepaces? Are 
they mandatory or not?
    I can surely add namespaces to primitive types as well... But I 
would rather first wait for the answers...

    Cheers,
    Martin

-- 
Martin Senger
    email: martin.senger at gmail.com
    skype: martinsenger




More information about the MOBY-dev mailing list