commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin van den Bemt <mll...@mvdb.net>
Subject Re: [Betwixt] escaping question
Date Fri, 11 Oct 2002 14:44:11 GMT
Sorry for the late reply.. See inline.

On Thu, 2002-10-10 at 20:37, mj m wrote:
> 
> Hi,
> I've been experimenting with Betwixt.  My need is
> very
> simple.  I'd like to turn some existing beans into
> xml
> files.  I've been able to do most of this fairly
> easily, but am having problems with a few things.
> 
> 1- Some of the bean properties contain strings with
> special characters. In some cases html.  Many of
> these
> are automatically escaped when I BeanWriter to
> output
> the bean.  Some are not: specifically doublequote
> and
> singlequote.  Is there something special I need to
> do
> to include certain special characters in the
> escaping?

Attributes are correctly escaped (the quotes and doublequotes you
mentioned). The body of an element does not escape these (which is also
not necessary). If you can provide some examples (xml+beans+and maybe a
testcase), I can see what's wrong and fix it. 


> 
> I looked at some of the junit testing files
> (TestBeanWriter in particular) to make sure I was
> structuring the code properly. 
> 
> 2- Is there a way to exempt certain bean properties
> when writing the bean out to xml?  For instance, if
> I
> had a bean with the properties name, age, and
> gender,
> but only wanted to include name and age in my xml?
> I know I could simply create a new bean with name
> and
> age only -- just wondering if there's a different
> way
> to do it.

Create a .betwixt file for your bean that you want to hide properties
from, using the hide element (see
http://jakarta.apache.org/commons/betwixt/overview.html, section
"Customizing the mapping of a bean to XML"

Mvgr,
Martin

> 
> 
> Thanks, 
> mjm
> 
> 
> __________________________________________________
> Do you Yahoo!?
> Faith Hill - Exclusive Performances, Videos & More
> http://faith.yahoo.com
> 
> --
> To unsubscribe, e-mail:   <mailto:commons-dev-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail: <mailto:commons-dev-help@jakarta.apache.org>
> 
> 



--
To unsubscribe, e-mail:   <mailto:commons-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:commons-dev-help@jakarta.apache.org>


Mime
View raw message