You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by sol myr <so...@yahoo.com> on 2006/01/16 10:21:51 UTC

Betwixt : writing namespace for every element ?

I'm using betwixt (BeanWriter) to print out some simple beans.
  All my xml tags belong to the same (single) namespace.  
  The twist is, I need the namespace prefix to be *explicitly* printed out, for the top element as well as for all its nested tags (that's for compatibility with an old system).
   
  Example:
  < reading:Book  xmlns:reading="myuri/read" >
       < reading:author >SomeAuthor < / reading:author >
       < reading:title > SomeTitle < / reading:title >
  < / reading:Book >

  It has to be < reading:author > and not just < author > .
   
  Now, I know how to do this the ugly way: use a "Book.betwixt" file and mention the uri for each and every property:
  < info primitiveTypes="element" >
    < element name='Book' uri='myuri/read" >
        < element name='title' property='title'  uri='myuri/read' / >
          < element name='author' property='author'  uri='myrui/read' / >
      < / element >
< / info >

  But is there a more elegant way to do it, without having to copy the same 'uri' attribute for each and every property ? I would just like to tell betwixt "assign this uri on Book, *and* to all its properties"...
   
  Thanx :)
   



			
---------------------------------
Yahoo! Photos
 Got holiday prints? See all the ways to get quality prints in your hands ASAP.