|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
need help on PARSE using XMLNSC |
« View previous topic :: View next topic » |
Author |
Message
|
hariwmb |
Posted: Wed May 23, 2012 7:44 pm Post subject: need help on PARSE using XMLNSC |
|
|
Newbie
Joined: 23 May 2012 Posts: 2
|
iam getting an xml in one of the field in the xml and i need to parse it and need to set it another field in the output message below i the xml iam getting
<CUST_H><NS1:ZZYCONT_LANGUAGE>DE</NS1:ZZYCONT_LANGUAGE><NS1:ZZYMEA></NS1:ZZYMEA><NS1:ZZY_SP_BID_TYP_H></NS1:ZZY_SP_BID_TYP_H><NS1:ZZYNTC></NS1:ZZYNTC><NS1:ZZYCOC></NS1:ZZYCOC><NS1:ZZYRP_MES_H></NS1:ZZYRP_MES_H><NS1:ZZYPROP_NAME></NS1:ZZYPROP_NAME><NS1:ZZYUCS>DL Z&M</NS1:ZZYUCS><NS1:ZZYPVI></NS1:ZZYPVI><NS1:ZZYSCI></NS1:ZZYSCI><NS1:ZZYLBR>A030104</NS1:ZZYLBR><NS1:ZZLEGAL></NS1:ZZLEGAL><NS1:ZZY_APP_ID></NS1:ZZY_APP_ID></CUST_H>
and im trying it to parse it by using below
DECLARE xmlString CHARACTER inputRef.SapImCpsSourceHeader.CUST_H;
CREATE LASTCHILD OF OutputRoot.XMLNSC.NS1:contract.NS1:customer_h DOMAIN ('XMLNSC') PARSE (xmlString CCSID 1208);
but getting xml parse errors |
|
Back to top |
|
 |
fjb_saper |
Posted: Wed May 23, 2012 7:55 pm Post subject: Re: need help on PARSE using XMLNSC |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
hariwmb wrote: |
iam getting an xml in one of the field in the xml and i need to parse it and need to set it another field in the output message below i the xml iam getting
Code: |
<CUST_H><NS1:ZZYCONT_LANGUAGE>DE</NS1:ZZYCONT_LANGUAGE><NS1:ZZYMEA></NS1:ZZYMEA><NS1:ZZY_SP_BID_TYP_H></NS1:ZZY_SP_BID_TYP_H><NS1:ZZYNTC></NS1:ZZYNTC><NS1:ZZYCOC></NS1:ZZYCOC><NS1:ZZYRP_MES_H></NS1:ZZYRP_MES_H><NS1:ZZYPROP_NAME></NS1:ZZYPROP_NAME><NS1:ZZYUCS>DL Z&M</NS1:ZZYUCS><NS1:ZZYPVI></NS1:ZZYPVI><NS1:ZZYSCI></NS1:ZZYSCI><NS1:ZZYLBR>A030104</NS1:ZZYLBR><NS1:ZZLEGAL></NS1:ZZLEGAL><NS1:ZZY_APP_ID></NS1:ZZY_APP_ID></CUST_H> |
and im trying it to parse it by using below
DECLARE xmlString CHARACTER inputRef.SapImCpsSourceHeader.CUST_H;
CREATE LASTCHILD OF OutputRoot.XMLNSC.NS1:contract.NS1:customer_h DOMAIN ('XMLNSC') PARSE (xmlString CCSID 1208);
but getting xml parse errors |
I know it's supposed to work on character, but for purity's sake should you not transform this first into a BLOB and parse the BLOB?.
I would not want any side effect to affect you, due to your definition of the Character variable... , and I'd expect the CCSID, the way you wrote your code, to have been 1200 instead of 1208...  _________________ MQ & Broker admin |
|
Back to top |
|
 |
hariwmb |
Posted: Wed May 23, 2012 8:49 pm Post subject: |
|
|
Newbie
Joined: 23 May 2012 Posts: 2
|
thanks for helping i tried like this
DECLARE messageBlob BLOB CAST(inputRef.SapImCpsSourceHeader.CUSTOMER_H AS BLOB CCSID 1200);
CREATE LASTCHILD OF OutputRoot.XMLNSC.NS1:contract.NS1:customer_h DOMAIN ('XMLNSC') PARSE (messageBlob);
but getting same xml parse errors |
|
Back to top |
|
 |
kimbert |
Posted: Thu May 24, 2012 12:50 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
Quote: |
getting xml parse errors |
How are we supposed to help without knowing what the errors were? In future, please quote the full text of the error message(s).
Quote: |
I know it's supposed to work on character, but for purity's sake should you not transform this first into a BLOB and parse the BLOB?. |
If you pass a CHARACTER field to the parser then the CCSID must be 1204 ( i.e. UTF-16 with platform endianness ). All CHARACTER data in the message tree is in UTF-16.
Try this:
Code: |
CREATE LASTCHILD OF OutputRoot.XMLNSC.NS1:contract.NS1:customer_h DOMAIN ('XMLNSC') PARSE (inputRef.SapImCpsSourceHeader.CUST_H); |
|
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
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
|
|
|
|