commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sol myr <solmyr_...@yahoo.com>
Subject Betwixt : writing namespace for every element ?
Date Mon, 16 Jan 2006 09:21:51 GMT
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.
Mime
  • Unnamed multipart/alternative (inline, 8-Bit, 0 bytes)
View raw message