my dog learned polymorphism
The moose likes Other JSE/JEE APIs and the fly likes Problem in castor please help Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Other JSE/JEE APIs
Bookmark "Problem in castor please help " Watch "Problem in castor please help " New topic

Problem in castor please help

Neha Mohit
Ranch Hand

Joined: Apr 25, 2006
Posts: 87
Hi ranchers,

First of all my apologies for not pasting the post on the proper forum.

I have problem in creating the proper xml file from java bean using castor; please help me.

Pasting the code, the mapping.xml for your reference.

The expected output should be
<?xml version="1.0"?>
<flight carrier="AR" depart="6:23a" arrive="8:42a" number="426"/>

The o/p i am getting is
<?xml version="1.0"?>
<flight-bean number="426">

Thanks in advance
[ June 27, 2007: Message edited by: Neha Mohit ]
Joe Ess

Joined: Oct 29, 2001
Posts: 9188

Change the node type to "attribute" for fields you want rendered as attributes:

[How To Ask Questions On JavaRanch]
I agree. Here's the link:
subject: Problem in castor please help
It's not a secret anymore!