Results 1 to 3 of 3

Thread: Using XML as a property value within a Spring context file?

Hybrid View

  1. #1
    Join Date
    Apr 2006
    Posts
    10

    Default 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. #2
    Join Date
    Aug 2004
    Location
    u.s.a
    Posts
    399

    Default

    Did you try wrapping it in a CDATA section?

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

  3. #3
    Join Date
    Apr 2006
    Posts
    10

    Default

    Doh! Overlooked the obvious again. Thanks, that worked

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •