java - Including CDATA wrapper while Marshalling -
java - Including CDATA wrapper while Marshalling -
i generating xml using xmlbeans . there way include cdata wrapper automatically required elements in output xml document . illustration , output xml should :
<employee> <name><![cdata[name]]></name> <address><![cdata[address]]></address> </employee>
1) can write xsd in such way , whenever set value <name>
element in programme using xmlbeans , output xml should contain name element : <name><![cdata[name]]></name>
instead of <name>name</name>
2) there way in xmlbeans produce cdata wrapper specific elements .
any help appreciated.
see this thread. in short:
node.setfoo("abcde12345"); xmlcursor c = node.xgetfoo().newcursor(); c.tofirstcontenttoken(); c.setbookmark(cdatabookmark.cdata_bookmark);
and when go "save" document sure pass in xmloptions like:
xmloptions opts = new xmloptions().setusecdatabookmarks(); node.xmltext(opts);
java xml xsd xml-serialization xmlbeans
Comments
Post a Comment