Author |
Message
|
pvsr |
Posted: Thu May 09, 2013 3:57 am Post subject: |
|
|
Novice
Joined: 06 May 2013 Posts: 12
|
what ever you said is correct .
I have done debugging then i came to know that what ever the code i have written wont work.
i need to make another code which will give me the exact output as i design.
Actually we are using mrm parser. so how can i add my encoding to that xml tag.
previously i have done this.
SET OutputRoot.XMLNSC = InputRoot.XMLNSC;
CREATE FIRSTCHILD OF OutputRoot.XMLNSC TYPE XMLNSC.XmlDeclaration;
SET OutputRoot.XMLNSC.(XMLNSC.XmlDeclaration)*.(XMLNSC.Attribute)Encoding = 'iso-8859-1';
So can anyone please let me what is the correct code for mrm domain which is getting xml as output that should add version and encoding in header of the output
[/url] |
|
Back to top |
|
 |
kash3338 |
Posted: Thu May 09, 2013 4:07 am Post subject: |
|
|
Shaman
Joined: 08 Feb 2009 Posts: 709 Location: Chennai, India
|
pvsr wrote: |
Actually we are using mrm parser. so how can i add my encoding to that xml tag.
|
Why are you using MRM parser to generate a XML message? What is the use of a XMLNSC parser then? |
|
Back to top |
|
 |
Vitor |
Posted: Thu May 09, 2013 4:53 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
pvsr wrote: |
Actually we are using mrm parser. so how can i add my encoding to that xml tag. |
Again I'll assume you mean that some other legacy flow is creating the document using the MRM domain otherwise (as others have said) your use of the XMLNSC domain as pointless as the use of the MRM domain for XML.
pvsr wrote: |
previously i have done this.
SET OutputRoot.XMLNSC = InputRoot.XMLNSC;
CREATE FIRSTCHILD OF OutputRoot.XMLNSC TYPE XMLNSC.XmlDeclaration;
SET OutputRoot.XMLNSC.(XMLNSC.XmlDeclaration)*.(XMLNSC.Attribute)Encoding = 'iso-8859-1'; |
Now look carefully at what your code is doing. You looking?
pvsr wrote: |
So can anyone please let me what is the correct code for mrm domain which is getting xml as output that should add version and encoding in header of the output |
Now you ask what is the correct code to add version and encoding to the header, and you know that you get 2 copies of the header (or declaration as it's more properly called).
So look back at your code, then at the results where you get 2 declarations, then at the trace we told you to take where you see the declararation already in the XML as it enters your code, and then ask yourself what that CREATE FIRSTCHILD you've coded is going to do.
Then think. While you're at it, think about what possible connection the MRM domain has to your code. If you come up with a connection, post it here.
And don't double post. If you don't like the answers you're getting here, don't start another thread in the hope of getting better ones. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
pvsr |
Posted: Thu May 09, 2013 5:36 am Post subject: |
|
|
Novice
Joined: 06 May 2013 Posts: 12
|
sorry for troubling you that we use xml for input parsing.
later when tranformation was done we get output as xml.
So here when am trying to use xmlnsc .
its giving me the double version as mentioned before.
so give me the exact code for the xml declaration.
 |
|
Back to top |
|
 |
Vitor |
Posted: Thu May 09, 2013 5:59 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
pvsr wrote: |
so give me the exact code for the xml declaration.
|
Vitor wrote: |
So look back at your code, then at the results where you get 2 declarations, then at the trace we told you to take where you see the declararation already in the XML as it enters your code, and then ask yourself what that CREATE FIRSTCHILD you've coded is going to do. |
Anything more clear would require you to send me money and reconsider your choice of profession.  _________________ Honesty is the best policy.
Insanity is the best defence.
Last edited by Vitor on Thu May 09, 2013 7:38 am; edited 1 time in total |
|
Back to top |
|
 |
kimbert |
Posted: Thu May 09, 2013 7:35 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
|
Back to top |
|
 |
pvsr |
Posted: Fri May 10, 2013 1:20 am Post subject: |
|
|
Novice
Joined: 06 May 2013 Posts: 12
|
Code: |
CREATE PROCEDURE SourceToTarget() BEGIN
--Form output msg
--Copy Message Headers
CALL CopyMessageHeaders();
SET OutputRoot.MQMD.Format='MQSTR';
--Get Queue Destination From Future Path Variable in EAI Header
IF (InputRoot.MQRFH2.usr.EAIHdr.futrPth) IS NULL OR (InputRoot.MQRFH2.usr.EAIHdr.futrPth = '' ) THEN
THROW EXCEPTION SEVERITY 3 MESSAGE 1561;
ELSE
-- need to set DestinationList from ';' delimited future path
DECLARE xLocalEnvironment REFERENCE TO OutputLocalEnvironment;
CALL SetMQDestination(xLocalEnvironment,InputRoot.MQRFH2.usr.EAIHdr.futrPth);
END IF;
--SET Response Message Properties
SET OutputRoot.Properties.Domain = 'MRM';
SET OutputRoot.Properties.MessageSet = 'APS_MESSAGESET';
SET OutputRoot.Properties.MessageType = 'Customer_master_APS';
SET OutputRoot.Properties.MessageFormat ='XML1';
SET OutputRoot.XML.(XML.XmlDecl) = ’’;
-- Set the Encoding within the XML Declaration
SET OutputRoot.XML.(XML.XmlDecl).(XML."Encoding") = 'ISO-8859-1'; |
|
|
Back to top |
|
 |
pvsr |
Posted: Fri May 10, 2013 1:23 am Post subject: |
|
|
Novice
Joined: 06 May 2013 Posts: 12
|
this is the code in last i have done that coding..
please let me know where i done wrong...
where i have to change the code or else something |
|
Back to top |
|
 |
Vitor |
Posted: Fri May 10, 2013 4:28 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
pvsr wrote: |
please let me know where i done wrong... |
Well that proves my assumption wrong. You are trying to use the MRM domain to output an XML document. You've been told repeatedly in this thread not to do that and seem either unwilling or unable to understand this is not right.
You've also managed to get the wrong method wrong. To use the MRM domain as this code is trying to, you'd need:
not
as you've coded.
Earlier in this thread you posted this:
Code: |
SET OutputRoot.XMLNSC = InputRoot.XMLNSC;
CREATE FIRSTCHILD OF OutputRoot.XMLNSC TYPE XMLNSC.XmlDeclaration;
SET OutputRoot.XMLNSC.(XMLNSC.XmlDeclaration)*.(XMLNSC.Attribute)Encoding = 'iso-8859-1'; |
where you're correctly using the XMLNSC domain. What made you change this? Have you now decided randomly changing your code until you hit the right combiniation is the way forward?
pvsr wrote: |
where i have to change the code or else something |
Obviously you have to change the code. If only to change it back from the rubbish you've most recently posted. You then have to find the something else you need to correct which we can't spoon feed you. We can't see your message, we can't see you flow and we can't see all your code. Even if we could, we have day jobs where we're paid to work in the same way this is your day job and you're paid to do it.
You've been given all the advice you need to find and fix the problem. Repeatedly. Now you have to work the problem as you're employed to do and resolve it.
If this is too much for you, you need to think about your career choices.  _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
pvsr |
Posted: Mon May 13, 2013 1:03 am Post subject: |
|
|
Novice
Joined: 06 May 2013 Posts: 12
|
|
Back to top |
|
 |
|