From: Wataru S. <sh...@se...> - 2007-08-31 21:19:29
|
Hi, I have been trying to serialize a resource in the database with some text nodes wrapped with CDATA section. However, I get the nodes not wrapped with CDATA section. Could anyone point me the correct way to do it? Here is what I did with eXist-1.1.1-newcore. XML resource (/docpress/cms/items.xml) <items xmlns=3D'http://docpress.org/ns/docpress'> <item> <extraction lang =3D"en"> <title><![CDATA[<span lang=3D"en">What is DocPress?</span>]]></title> </extraction> </item> </items> XQuery to serialize item node with the text under title element wrapped with CDATA section: declare namespace cms =3D 'http://docpress.org/ns/docpress'; let $item :=3D document('/docpress/cms/items.xml')/cms:items/cms:item return util:serialize($item, ("indent=3Dyes", "cdata-section-elements=3D{http://docpress.org/ns/docpress}title")) The result I get: <item xmlns=3D'http://docpress.org/ns/docpress'> <extraction lang =3D"en"> <title><span lang=3D"en">What is DocPress?</span></title> </extraction> </item> I get the same result when I set the serialize option without the namespace as "cdata-section-elements=3Dtitle". Best regards, Wataru Shito (Room 3.26) =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D sh...@se... http://www.wshito.com =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D |