Announcement Announcement Module
Collapse
No announcement yet.
Using XML as a property value within a Spring context file? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Using XML as a property value within a Spring context file?

    Hi,

    I want to create some test data consisting of XML within a spring context file. Something like:

    <bean id="data-xmltest-user12345" class="java.lang.String">
    <constructor-arg index="0" type="java.lang.String">
    <value>
    <NetworkProfileUser mlns="http://www.hodo.org/test/ns">
    <UserId>12345</UserId>
    <Name>Carmen Electra</Name>
    </NetworkProfileUser>
    </value>
    </constructor-arg>
    </bean>

    Currently this breaks when creating the ApplicationContext. Is there any way to tell the <value> that this is XML and it is what I want?

    Thanks,

    Mike

  • #2
    Did you try wrapping it in a CDATA section?

    Example:
    Code:
    <![CDATA[<greeting>Hello, world!</greeting>]]>
    -- Josef

    Comment


    • #3
      Doh! Overlooked the obvious again. Thanks, that worked

      Comment

      Working...
      X