java adding cdata to xml string
问题 I need to add CDATA to xml string for sign it with certificate. String looks like: <SignedContent>someparametres</SignedContent> Result must be like: <![CDATA[<SignedContent>someparametres</SignedContent>]]> How can i do this? Pls help P.S. Xml string has only one row (removed all tabs, all spaces, BOM) 回答1: It sounds like you just want: Node cdata = doc.createCDATASection(text); parentElement.appendChild(cdata); 回答2: This post may be hold but i feel i should respond, this may help someone