commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ricardo Gladwell <ricardo.gladw...@btinternet.com>
Subject [Betwixt] Removing id attributes and conditional
Date Fri, 13 May 2005 16:58:02 GMT
Hi All,

I'm writing some Java beans to XML and getting some odd results. 
Firstly, Betwixt is adding an "id" attribute to all my objects (see 
sample payment.xml below). How do I configure Betwixt stop this behaviour?

I also would like to switch tags based on the type of an object 
returned. For example, I have a Customer object that returns a BankAccount:

//BankAccount.java
public abstract class BankAccount {}

//Customer.java
public class Customer {
   BankAccount bankAccount;
   public BankAccount getBankAccount() { return bankAccount; }
}

//AustrianBankAccount.java
public class AustrianBankAccount extends BankAccount {
}

I have the following betwixt file which specifies that the root tag for 
an AustrianBankAccount is "bankAccount-AT":

//AustrianBankAccount.betwixt
<?xml version="1.0" encoding="UTF-8" ?>
<info primitiveTypes="element">
   <element name="bankAccount-AT">
     <addDefaults />
   </element>
</info>

But, in my results it still returns a "bankAccount" tag. How do I 
enforce this behaviour?

// payment.xml
<?xml version="1.0"?>
<!DOCTYPE paymentService PUBLIC "-//Bibit//DTD Bibit PaymentService v1//EN"
	"http://dtd.bibit.com/paymentService_v1.dtd">

<paymentService id="1" merchantCode="OPODOPAYOUTEUR" version="1.3">
<submit>
<shopper id="2">
<bankAccount id="3">
<accountHolderName>com.opodo.backoffice.db.dao.mock.MockCustomerDAO</accountHolderName>
<branchCode>25267</branchCode>
<bankAccountNumber>85584111755</bankAccountNumber>
</bankAccount>
<authenticatedShopperID>0656125732</authenticatedShopperID>
</shopper>
</submit>
</paymentService>

Kind regards...

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Mime
View raw message