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 » problem with Namespace on the root Pls help me

Post new topic  Reply to topic Goto page Previous  1, 2
 problem with Namespace on the root Pls help me « View previous topic :: View next topic » 
Author Message
jefflowrey
PostPosted: Mon Feb 26, 2007 8:38 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

http://publib.boulder.ibm.com/infocenter/wmbhelp/v6r0m0/index.jsp?topic=/com.ibm.etools.mft.doc/ac16730_.htm
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
bhaski
PostPosted: Mon Feb 26, 2007 8:40 am    Post subject: Reply with quote

Voyager

Joined: 13 Sep 2006
Posts: 78
Location: USA

The Input Databody is not having any name space and under name body the elements could be any kind of name. it is not in the same order. Pls let me know how to add the subelement of <databody> from input to the output under <databody>. the output is having name space like



SET OutputRoot.XMLNS.inpns:MessageHDR.(XML.NamespaceDecl)xmlns = 'http://tempuri.org/InBnd WrkStationHeaderXML.xsd';
SET OutputRoot.XMLNS.inpns:MessageHDR.inpns:User = Input...;
SET OutputRoot.XMLNS.inpns:MessageHDR.inpns:PartnerBillingID = Input....;

How can I add the subelement of <DATABODY> FROM MY INPUT TO MY OUTPUT.

OutputRoot .XMLNS.inpns:MessageHDR.inpns:DATABody = < Here I need to add all the subelement of my DATABODY FROM INPUT>


Pls

Bhaski.
Back to top
View user's profile Send private message
Vitor
PostPosted: Mon Feb 26, 2007 8:52 am    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

bhaski wrote:
Pls let me know how to add the subelement of <databody> from input to the output under <databody>.


The link provided by jefflowrey includes a section on anonomous reference of elements and examples. All you're trying to do is reference all the sub elements in your input, adding them to the output. This is not tricky; there are a couple of methods you could select

If the manual doesn't help (which it should), Mr Google or the forum search show turn up some stuff.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
kimbert
PostPosted: Mon Feb 26, 2007 8:53 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5543
Location: Southampton

Please post an example of the output message that you want to get.
Back to top
View user's profile Send private message
vsr
PostPosted: Mon Feb 26, 2007 8:59 am    Post subject: Reply with quote

Centurion

Joined: 04 Apr 2006
Posts: 104

I hope this should work :

SET OutputRoot.XMLNS.inpns:MessageHDR.inpns:DATABody[] = (SELECT T AS Order FROM InputRoot.XMLNS.MessageHDR.DATABODY[] AS T);
Back to top
View user's profile Send private message
bhaski
PostPosted: Mon Feb 26, 2007 9:04 am    Post subject: Reply with quote

Voyager

Joined: 13 Sep 2006
Posts: 78
Location: USA

Hi kimbert

This is my model out

<?xml version="1.0"?>
<MessageHDR xmlns= "http://tempuri.org/InBnd WrkStationHeaderXML.xsd">
<User />
<Filename>c:\test.txt</Filename>
<Applid>text</Applid>
<FileID>100</FileID>
<MessageDTL>
<First/>
<First/>
<First/>
<First/>
<First/>
<First/>
<second/>
<second>text</second>
<second/>
<second>corp</second>
<thrid>Anthony Montemorra</thrid>
<four>Anthony Montemorra</four>
<five/>
<six/>
</MessageDTL>
<DATABody>
<ELEMENT>
<ELEMENT1_NAME>Entity Name</ELEMENT1_NAME>
<ELEMENT1_CODE>111</ELEMENT1_CODE>
<ELEMENT_GROUP_CODE>ADDINSURED</ELEMENT_GROUP_CODE>
</ELEMENT>

<ELEMENT>
<ELEMENT1_NAME>Entity Name</ELEMENT1_NAME>
<ELEMENT1_CODE>363</ELEMENT1_CODE>
<ELEMENT_GROUP_CODE>ADDINSURED</ELEMENT_GROUP_CODE>
</ELEMENT>
<ELEMENT>
<ELEMENT1_NAME>Entity Name</ELEMENT1_NAME>
<ELEMENT1_CODE>363</ELEMENT1_CODE>
<ELEMENT_GROUP_CODE>ADDINSURED</ELEMENT_GROUP_CODE>
</ELEMENT>
<ELEMENT>
<ELEMENT1_NAME>Entity Name</ELEMENT1_NAME>
<ELEMENT1_CODE>363</ELEMENT1_CODE>
<ELEMENT_GROUP_CODE>ADDINSURED</ELEMENT_GROUP_CODE>
</ELEMENT>
</DATABody>
</MessageHDR>


The subelement name could be anything and it is XML format. Today it is <ELEMENT></ELEMENT>,
TOmorrow it may be
<newElement></newElement>

Pls ignore if any case sensitive problem



Thanks
Bhaski.
Back to top
View user's profile Send private message
kimbert
PostPosted: Mon Feb 26, 2007 9:35 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5543
Location: Southampton

Right. Now I understand the problem.
- None of the elements in your input message have a namespace
- All of the elements in your output message have a namespace

You need to perform a deep walk of the input message and for each element at each level you need to
a) copy it to the output message
b) set its namespace to "http://tempuri.org/InBnd WrkStationHeaderXML.xsd"

You also need to put a default namespace declaration on the root node of the output message tree.
Back to top
View user's profile Send private message
bhaski
PostPosted: Mon Feb 26, 2007 9:59 am    Post subject: Reply with quote

Voyager

Joined: 13 Sep 2006
Posts: 78
Location: USA

Kimbert

Can you Pls look into my previous message. I included everything , but when i add this subelement ( children ) of Databody, it is not accepting, cos the subelement is not included with namepsace, since it is unknown to me.

Okay Pls let me know

how to move the cursor from DATABODY consider that as a root

<DATABody>
<ELEMENT>
<ELEMENT1_NAME>Entity Name</ELEMENT1_NAME>
<ELEMENT1_CODE>111</ELEMENT1_CODE>
<ELEMENT_GROUP_CODE>ADDINSURED</ELEMENT_GROUP_CODE>
</ELEMENT>

<ELEMENT>
<ELEMENT1_NAME>Entity Name</ELEMENT1_NAME>
<ELEMENT1_CODE>363</ELEMENT1_CODE>
<ELEMENT_GROUP_CODE>ADDINSURED</ELEMENT_GROUP_CODE>
</ELEMENT>
<ELEMENT>
<ELEMENT1_NAME>Entity Name</ELEMENT1_NAME>
<ELEMENT1_CODE>363</ELEMENT1_CODE>
<ELEMENT_GROUP_CODE>ADDINSURED</ELEMENT_GROUP_CODE>
</ELEMENT>
<ELEMENT>
<ELEMENT1_NAME>Entity Name</ELEMENT1_NAME>
<ELEMENT1_CODE>363</ELEMENT1_CODE>
<ELEMENT_GROUP_CODE>ADDINSURED</ELEMENT_GROUP_CODE>
</ELEMENT>
</DATABody>


to each and every element inside the <DATABODY>, tell me the first step and for first element, remaining I will make recursive function.

Bhaski.
Back to top
View user's profile Send private message
kimbert
PostPosted: Tue Feb 27, 2007 1:14 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5543
Location: Southampton

Did you read this? http://publib.boulder.ibm.com/infocenter/wmbhelp/v6r0m0/index.jsp?topic=/com.ibm.etools.mft.doc/ac16730_.htm
Back to top
View user's profile Send private message
vsr
PostPosted: Tue Feb 27, 2007 5:48 am    Post subject: Reply with quote

Centurion

Joined: 04 Apr 2006
Posts: 104

Try this:
Quote:

DECLARE I INTEGER 1;
DECLARE J INTEGER 1;
DECLARE inpns NAMESPACE 'http://tempuri.org/InBnd WrkStationHeaderXML.xsd';

J = CARDINALITY (InputRoot.XMLNS.MyRequest.DATABODY.ELEMENT[]);

WHILE ( I < J)
SET OutputRoot.XMLNS.inpns:MessageHDR.DATABody[I] = InputRoot.XMLNS.MyRequest.DATABODY.ELEMENT[I] ;
END WHILE;


But we should be careful while copying the entire tree ;here both input and output tree have same format so we can safely use this code .
At the same time you would have tried different things in the esql - I guess it won't take as much time time as you posted your replies . It's a ESQL basic thing


http://publib.boulder.ibm.com/infocenter/wmbhelp/v6r0m0/index.jsp?topic=/com.ibm.etools.mft.doc/ac20420_.htm
Back to top
View user's profile Send private message
bhaski
PostPosted: Tue Feb 27, 2007 6:32 am    Post subject: Reply with quote

Voyager

Joined: 13 Sep 2006
Posts: 78
Location: USA

Hello all

I don't know the element name inside the <DATABODY> in the input file. there is some xml element inside the DATABODY. When I am copying the whole subelement of DATABODY, i am getting some problem with namespace. So pls let me know how to read the unknown element in my case with the about sample input? Can you Pls show me with ESQL sample?

Bhaski.
Back to top
View user's profile Send private message
vsr
PostPosted: Tue Feb 27, 2007 6:52 am    Post subject: Reply with quote

Centurion

Joined: 04 Apr 2006
Posts: 104

Quote:
When I am copying the whole subelement of DATABODY, i am getting some problem with namespace.


How do you know you are getting some problem ? How do you know that the problem is with namespace ? What are the methods you tried? Paste your code and place a trace node after the compute node and paste the trace and error code too ...

I suggest try reading about xml-namespaces and working with XMLNS parser from the information center.
Back to top
View user's profile Send private message
bhaski
PostPosted: Fri Mar 09, 2007 1:55 pm    Post subject: Reply with quote

Voyager

Joined: 13 Sep 2006
Posts: 78
Location: USA

Hi friends

I have done this by using AsisElement of XML after convertering a String.
Thanks for your effort and ideas


Bhaski.
Back to top
View user's profile Send private message
kimbert
PostPosted: Sat Mar 10, 2007 12:51 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5543
Location: Southampton

Hmmm. What exactly did you do?
Back to top
View user's profile Send private message
bhaski
PostPosted: Tue Mar 20, 2007 9:01 am    Post subject: Reply with quote

Voyager

Joined: 13 Sep 2006
Posts: 78
Location: USA

I just added all the element inside the databody Using AsisElement.


DECLARE options INTEGER BITOR(FolderBitStream, ValidateContent,
ValidateValue);

DECLARE ref REFERENCE TO InputRoot.XMLNS.MyRequest .Request.DATABODY;
DECLARE myString CHARACTER CAST(ASBITSTREAM(ref,,1208,,,,options) AS CHARACTER CCSID InputRoot.MQMD.CodedCharSetId ENCODING InputRoot.MQMD.Encoding);
SET OutputRoot.XMLNS.inpns:MessageHDR.inpns:DATABODY.(XML.AsisElementContent) =


Thank you all for the support

Love and Pray
Bhaski.
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 » problem with Namespace on the root Pls help me
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.