Apache Struts 2 Documentation > Home > FAQs > Why does WW ignore my message when its enclosed in CDATA |

Apache Struts 2 Documentation
Why does WW ignore my message when its enclosed in CDATA
Edit Page Browse Space Add Page Add News
Added by tm_jee, last edited by Ted Husted on Jul 22, 2006 (view change)

Try not to separate the message tag and CDATA portion. Tthe parser might creates a text node enclosing the CDATA one if it sees any space, and xwork just reads the first node (therefore, an empty text). Example:-

    <field name="password">
      <field-validator type="requiredstring">
       <message><![CDATA[ Debe proporcionar una contraseÃÂ±a para el usuario. ]]></message>
      </field-validator>
    </field>

Note: there's no spacing in the following line

    <message><![CDATA[ ...]]></message>

Contributor: Ruben