commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Daniel Salhany" <>
Subject Object containing an object of itself
Date Mon, 19 Dec 2005 16:11:15 GMT
I have an a class similar to the following.


public class Content{


            private List children;

            private String content_type;

            private int cid;


            public List getChildren() {

                        return children;



            public void setChildren(List children) {

                        this.children = children;



            public int getCid() {

                        return cid;



            public void setCid(int cid) {

                        this.cid = cid;



            public String getContent_type() {

                        return content_type;



            public void setContent_type(String content_type) {

                        this.content_type = content_type;




The List children will contain object that are all of type Content


I have a .betwixt file that generates xml for the class Content as below


<?xml version='1.0' encoding='UTF-8'?>


<element name='content:content'>

      <attribute name='xmlns:content'

      <attribute name='xmlns' value=''/>

      <attribute name='cid' property='contentId'/>

      <attribute name='content_type' property='type'/>


      <element name='content:content' property='childContent'>





My problem is that I only want the 2 namespaces elements xmlns:content
and xmlns to appear on the top level Content object and not any of its
children but as soon as I add the childContent element(s) to the betwixt
file the xml that is produced will contain these as attributes. Is there
any way to solve this using .betwixt files?








  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message