Posted: Sun Mar 04, 2007 6:55 am Post subject: CacheReplay and CData
Acolyte
Joined: 07 Feb 2006 Posts: 72
We have WMB 6.
I am trying to store an xml tree in cache using the Cache data nodes.
To store the data, I used the following ESQL as input to a CachePut node:
Declare data Char;
Set data = CAST(ASBITSTREAM(InputRoot.XML.CacheTable OPTIONS FolderBitStream) AS CHARACTER CCSID 437 ENCODING 546);
Set OutputRoot.XML.go.key = 'LogCacheJobTable';
Set OutputRoot.XML.go.data.(XML.CDataSection) = data;
I then tried to use a CacheReplay node to retrieve the cache. The data looked like this (via trace node) after the CacheReplay:
(0x01000010):XML = (
..(0x01000000):go = (
....(0x01000000):results = (
......(0x01000000):LogCacheJobTable = (
........(0x02000000): = '<CacheTable><JobData>...</JobData></CacheTable>'
I try to parse it using the following code, and it always evaluates CDataSection as NULL:
Set OutputRoot.XML.go.results.LogCacheJobTable.(XML.AsisElementContent) = InputRoot.XML.go.results.LogCacheJobTable.(XML.CDataSection);
Any help converting the CData section of the cached data back to an XML tree would be much appreciated.
Declare xmlData Char;
Set xmlData = InputRoot.XML.go.results.LogCacheJobTable;
Set OutputRoot.XML.go.results.LogCacheJobTable.(XML.AsisElementContent) = xmlData;
This picked up the data, but it is still being stored as string content.
(0x01000010):XML = (
..(0x01000000):go = (
...(0x01000000):results = (
......(0x01000000):LogCacheJobTable = (
......(0x06000028): = '<CacheTable><JobData>..</JobData></CacheTable>'
How do I get the character data converted to an xml tree?
-- Create some base elements
CREATE FIELD OutputRoot.XML.go;
CREATE FIELD OutputRoot.XML.go.results;
-- Convert CData in cache to XML tree
CREATE LASTCHILD OF OutputRoot.XML.go.results DOMAIN ('XML')
PARSE(InputRoot.XML.go.results.LogCacheJobTable, 546, 437);
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum