ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Esql help on string to xml

Post new topic  Reply to topic Goto page Previous  1, 2
 Esql help on string to xml « View previous topic :: View next topic » 
Author Message
jefflowrey
PostPosted: Wed Dec 20, 2006 2:02 pm    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

You can't use XMLNSC in v5, true.

But you can and should use XMLNS.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
Bravo
PostPosted: Wed Dec 20, 2006 2:25 pm    Post subject: Reply with quote

Centurion

Joined: 03 Oct 2005
Posts: 146

Jeff,

I try executing the code with Domain as XMLNS

Code:
CREATE LASTCHILD OF Environment DOMAIN('XMLNS') PARSE(InputLocalEnvironment.ResultSet[1].GENRC_DATA_CHAR, InputProperties.Encoding,InputProperties.CodedCharSetId);
      
            
      DECLARE I INTEGER 2;
      DECLARE J INTEGER CARDINALITY(InputLocalEnvironment.ResultSet[]);
      WHILE I <= J DO
         CREATE NEXTSIBLING OF Environment.XMLNS.INVOICEMSG PARSE(InputLocalEnvironment.ResultSet[I].GENRC_DATA_CHAR, InputProperties.Encoding,InputProperties.CodedCharSetId);
         SET I = I + 1;
      END WHILE;


The o/p came as

Environment.XMLNS.INVOICEMSG[1];
Environment.XMLNS.INVOICEMSG[2].XMLNS.INVOICEMSG;
Environment.XMLNS.INVOICEMSG[3].XMLNS.INVOICEMSG;

I tried with this code with Domain as XMLNS

Code:
      DECLARE rResultSet REFERENCE TO InputLocalEnvironment.ResultSet;   
      DECLARE bFirstResultSet BOOLEAN true;

-- Create a reference to use later
      DECLARE rEnv REFERENCE TO InputRoot;
         
      WHILE LASTMOVE(rResultSet) DO         
             
       IF (bFirstResultSet) THEN
           CREATE LASTCHILD OF Environment AS rEnv DOMAIN 'XMLNS' NAME 'XML';
          SET bFirstResultSet = false;
      ELSE
          CREATE NEXTSIBLING OF rEnv AS rEnv REPEAT;
       END IF;
             
       CREATE LASTCHILD OF rEnv PARSE(rResultSet.GENRC_DATA_CHAR, InputProperties.Encoding,InputProperties.CodedCharSetId);
       
         MOVE rResultSet NEXTSIBLING NAME 'ResultSet';

      END WHILE;


The o/p came as

Environment.XML[1].XMLNS.INVOICEMSG;
Environment.XML[2].XMLNS.INVOICEMSG;
Environment.XML[3].XMLNS.INVOICEMSG;

No luck
_________________
Bravo
Back to top
View user's profile Send private message
kimbert
PostPosted: Wed Dec 20, 2006 4:02 pm    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5543
Location: Southampton

Hi Bravo,
- Jeff and I did not expect the XMLNS domain to solve all your problems. It's simply bad practice to use XML domain in new flows.
- I recommend using FolderBitstream mode when parsing the INVOICEMSG. That will get rid of the extra 'XMLNS' level in the message tree.
- You have changed your requirement. Your previous post included a repeating field with name 'Data'. Now it looks as if you want to get
Code:
Environment
    XMLNS
        INVOICEMSG[1]
        INVOICEMSG[2]
        INVOICEMSG[3]


So I think you need a much simpler loop which executes a line of code something like this:
Code:
CREATE LASTCHILD OF Environment.XMLNS PARSE (...) OPTONS FolderBitStream 
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Goto page Previous  1, 2 Page 2 of 2

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Esql help on string to xml
Jump to:  



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
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.