Hi Weez,

The easiest way to do this is to include a .betwixt file in your CLASSPATH. The details of this file are specified on the Betwixt website. Effectively, you need to include a hide element in this file that points to the element(s) that you don't want printed.

-- example.betwixt --
<?xml version='1.0' encoding='UTF-8' ?>
<info primitiveTypes="attribute">
<hide property="customers"> <-- This suppresses the output of customers
<element name='customerbean'>
<addDefaults/>
</element>
</info>


HTH,
Vikram
---------------------------------------------------------------------------------------
Jakarta Commons Online Bookshelf
Module 5: JXPath and Betwixt: http://www.manning.com/catalog/view.php?book=goyal5
All Modules: http://www.manning.com/goyal
---------------------------------------------------------------------------------------


----- Original Message ----- From: "WeeZard" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Monday, May 02, 2005 9:44 PM
Subject: [Betwixt] Excluding a bean from parsing into XML



Hello,

I'm new to Betwixt, and even more new to Java so this may be a newbie question ;-)

For example, I got a class, something like this:

public class CustomerBean {
   private String name;
   private CustomerBean customers;

   public String getName();
   public CustomerBean getCustomers();

}

When I call SAXBeanWriter.write(...), I would like to tell Betwixt NOT to include "customers" in the output XML document. How do I do that?


tnx a lot for any tips on this subject

Weez



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to