Back Forum Reply New

How to use xml in a bean property?

.apache.xerces.internal.util.ErrorHandl  erWrapper.createSAXParseException(ErrorHandlerWrap  per.java:236)

Here is my bean definition,Code:
lt;bean id=quot;testquot; class=quot;Testquot;gt;
lt;property name=quot;passThroughquot;gt;
lt;valuegt;
lt;?xml version=quot;1.0quot; encoding=quot;UTF-8quot;?gt;
lt;passthrType value=quot;testquot; version=quot;2.0quot;gt;
lt;!--other steps to simulate telnet connection--gt;
lt;/passthrTypegt;
lt;/valuegt;
lt;/propertygt;
lt;/beangt;
How can I specify a xml text in a bean's property? Thanks!

Hiya

Use CDATA sections.Code:
lt;bean id=quot;testquot; class=quot;Testquot;gt;   lt;property name=quot;passThroughquot;gt;       lt;valuegt;lt;![CDATA[lt;?xml version=quot;1.0quot; encoding=quot;UTF-8quot;?gt;   lt;passthrType value=quot;testquot; version=quot;2.0quot;gt;
lt;!--other steps to simulate telnet connection--gt;   lt;/passthrTypegt;]]gt;lt;/valuegt;   lt;/propertygt;
lt;/beangt;
Cheers
Rick
¥
Back Forum Reply New