Posted: Fri Jul 12, 2002 4:23 am Post subject: Parsing XML with CDATA characters
Master
Joined: 11 Sep 2001 Posts: 224
Hi,
A have an XML coming to my MQInput node and i need to remove from the message all the cdata characters, such as tab, CR, space, which are between tags.
As there any easy way to do it?
Thanks, _________________ Lillo
IBM Certified Specialist - WebSphere MQ
Posted: Fri Jul 12, 2002 6:12 am Post subject: Parse string in hexadecimal
Newbie
Joined: 29 May 2002 Posts: 2 Location: France
You can move your string in a blob and make a loop to parse each carracter in HEX and contruct a blob without your specials chars.
A last you cast your blob variable into string.
Sample (not tested):
DECLARE A INTEGER
DECLARE TEMP BLOB;
DECLARE NEW_TEMP BLOB;
DECLARE OLD_TEMP BLOB;
SET A = 1;
SET OLD_TEMP=CAST(Input AS BLOB);
SET NEW_TEMP='';
WHILE A <= LENGTH(TEMP) DO
SET TEMP=UPPER(SUBSTRING(OLD_TEMP from A for 2));
-- The ASCII CODE of the char that you want to remove
IF TEMP ='09' THEN
SET NEW_TEMP=NEW_TEMP||'40';
ELSE
SET NEW_TEMP=NEW_TEMP||TEMP;
END IF;
SET A=A+2;
END WHILE;
SET RESULT=CAST(NEW_TEMP AS CHAR);
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