Hi Jeff, On Fri, 2006-08-18 at 13:19 -0700, Jeff Marendo wrote: > Hello, > > I'm using the Commons Digester, specifically, to read data from XML files > in order to create objects and I later use Betwixt to write objects out to > XML. I'm using Digester "rules" files to specifiy XML layout so a known > pattern is used while reading and creating objects. >
[snip] > How can I instruct Betwixt (the BeanWriter instance, I think) to write out > the info so that it matches the pattern that I'm using when reading? > Perhaps I should just be using Betwixt for both reading and writing, but I'd > still like to be able to set things up, explicitly, so that the XML format > for a given class is knowing ahead of time (so the format for reading and > writing is the same). > > Please reply, if someone has an idea about this. Thanks! Yes you should probably be using Betwixt for both reading and writing (betwixt uses Digester internally for reading anyway). You can create a .betwixt file for a class to define how you want the xml to be written/read, eg for class "example.foo.Bar", create a file "example.foo.Bar.betwixt" containing the necessary definitions. This file is used automatically when an object is *written to xml* by betwixt. When reading xml, you do need to "register" the classes that you expect to be reading from the xml; betwixt then finds the appropriate .betwixt files for them to use when reading the xml in. See the betwixt documentation for further details; the examples show how to do all this. If you do want to ask further questions on this list, please place the name(s) of the relevant commons subprojects in the subject line, eg [betwixt][digester] How do I xxyyzzz... Regards, Simon --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
