commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Daniel Salhany" <dsalh...@hnw.com>
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'?>

<info>

<element name='content:content'>

      <attribute name='xmlns:content'
value='http://hnw.com/schema/content_v1'/>

      <attribute name='xmlns' value='http://www.w3.org/1999/xhtml'/>

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

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

      

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

      </element>

</element>

</info>

 

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?

 

 

 

 

 

 

 


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