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 » Add header in XML

Post new topic  Reply to topic
 Add header in XML « View previous topic :: View next topic » 
Author Message
vsethi007
PostPosted: Thu Apr 17, 2008 9:15 am    Post subject: Add header in XML Reply with quote

Novice

Joined: 17 Apr 2008
Posts: 19

Hi

I need to add a header in XML
<?Siebel-Property-Set EscapeNames="false"?>

I tried using two approaches :

1 Approach
SET OutputRoot.XML.(XML.XmlDecl).(XML.Siebel-Property-Set)='';
SET OutputRoot.XML.(XML.XmlDecl).(XML."EscapeNames")='true';

2 Approach
SET OutputRoot.XMLNS.(XML.XmlDecl)"Siebel-Property-Set" ='';
SET OutputRoot.XMLNS.(XML.XmlDecl)"Siebel-Property-Set".(XML.attr)"EscapeNames" = 'true';

but it din't worked out, Could anyone plese help how to do that.
Back to top
View user's profile Send private message
Vitor
PostPosted: Thu Apr 17, 2008 2:14 pm    Post subject: Re: Add header in XML Reply with quote

Grand High Poobah

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

vsethi007 wrote:
it din't worked out


What happened in each case - "it didn't work out" isn't a lot to go on. Error messages, posting of a section of user trace, amy other information? Version of WMB?

Help us to help you.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
kimbert
PostPosted: Thu Apr 17, 2008 2:35 pm    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

Never use the XML domain in a new message flow. XMLNS is identical apart from its namespace support. XMLNSC is faster ( on v6 ), much faster and has more features ( on v6,1 ) and is the recommended parser for new flows.

Quote:
I need to add a header in XML
<?Siebel-Property-Set EscapeNames="false"?>
You don't need to add a header. You need to add a processing instruction.
Back to top
View user's profile Send private message
vsethi007
PostPosted: Fri Apr 18, 2008 7:12 am    Post subject: Reply with quote

Novice

Joined: 17 Apr 2008
Posts: 19

Thanks for your responses
I am using WMB Toolkit version 6.0.2

for below approach

SET OutputRoot.XML.(XML.XmlDecl)"Siebel-Property-Set" = '';
SET OutputRoot.XML.(XML.XmlDecl)"EscapeNames" = 'false';

the exception tree is:
<ExceptionData>
<RecoverableException>
<File>F:\build\S600_P\src\DataFlowEngine\ImbMqOutputNode.cpp</File>
<Line>782</Line>
<Function>ImbMqOutputNode::evaluate</Function>
<Type>ComIbmMQOutputNode</Type>
<Name>test12#FCMComposite_1_2</Name>
<Label>test12.MQOutput</Label>
<Catalog>BIPv600</Catalog>
<Severity>3</Severity>
<Number>2230</Number>
<Text>Caught exception and rethrowing</Text>
<ParserException>
<File>F:\build\S600_P\src\MTI\MTIforBroker\GenXmlParser2\XmlImbParser.cpp</File>
<Line>380</Line>
<Function>XmlImbParser::refreshBitStreamFromElements</Function>
<Type>ComIbmComputeNode</Type>
<Name>test12#FCMComposite_1_3</Name>
<Label>test12.Compute</Label>
<Catalog>BIPv600</Catalog>
<Severity>3</Severity>
<Number>5010</Number>
<Text>XML Writing Errors have occurred</Text>
<ParserException>
<File>F:\build\S600_P\src\MTI\MTIforBroker\GenXmlParser2\XmlImbParser.cpp</File>
<Line>837</Line>
<Function>XmlImbParser::checkForBodyElement</Function>
<Type></Type>
<Name></Name>
<Label></Label>
<Catalog>BIPv600</Catalog>
<Severity>3</Severity>
<Number>5005</Number>
<Text>No valid body of the document could be found.</Text>
</ParserException>
</ParserException>
</RecoverableException>
</ExceptionData>


for below Approach
SET OutputRoot.XMLNS.(XML.XmlDecl)"Siebel-Property-Set" ='';
SET OutputRoot.XMLNS.(XML.XmlDecl)"Siebel-Property-Set".(XML.attr)"EscapeNames" = 'true';


the exception tree is:
<ExceptionData>
<RecoverableException>
<File>F:\build\S600_P\src\DataFlowEngine\ImbMqOutputNode.cpp</File>
<Line>782</Line>
<Function>ImbMqOutputNode::evaluate</Function>
<Type>ComIbmMQOutputNode</Type>
<Name>test12#FCMComposite_1_2</Name>
<Label>test12.MQOutput</Label>
<Catalog>BIPv600</Catalog>
<Severity>3</Severity>
<Number>2230</Number>
<Text>Caught exception and rethrowing</Text>
<ParserException>
<File>F:\build\S600_P\src\MTI\MTIforBroker\GenXmlParser2\XmlImbParser.cpp</File>
<Line>380</Line>
<Function>XmlImbParser::refreshBitStreamFromElements</Function>
<Type>ComIbmComputeNode</Type>
<Name>test12#FCMComposite_1_3</Name>
<Label>test12.Compute</Label>
<Catalog>BIPv600</Catalog>
<Severity>3</Severity>
<Number>5010</Number>
<Text>XML Writing Errors have occurred</Text>
<ParserException>
<File>F:\build\S600_P\src\MTI\MTIforBroker\GenXmlParser2\XmlImbParser.cpp</File>
<Line>837</Line>
<Function>XmlImbParser::checkForBodyElement</Function>
<Type></Type>
<Name></Name>
<Label></Label>
<Catalog>BIPv600</Catalog>
<Severity>3</Severity>
<Number>5005</Number>
<Text>No valid body of the document could be found.</Text>
</ParserException>
</ParserException>
</RecoverableException>
</ExceptionData>
Back to top
View user's profile Send private message
Vitor
PostPosted: Fri Apr 18, 2008 10:46 am    Post subject: Reply with quote

Grand High Poobah

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

vsethi007 wrote:
for below Approach
SET OutputRoot.XMLNS.(XML.XmlDecl)"Siebel-Property-Set" ='';
SET OutputRoot.XMLNS.(XML.XmlDecl)"Siebel-Property-Set".(XML.attr)"EscapeNames" = 'true';


That's still trying to create an xml declaration not a processing instruction. Using a construct in the wrong domain.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
kimbert
PostPosted: Fri Apr 18, 2008 10:57 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

There's a good reason why you are getting an exception. You are building an output tree which contains an XML declaration in the body of the document..
You should be building a message tree with a processing instruction.

Try this:
Code:
Set OutputRoot.XMLNSC.(XMLNSC.ProcessingInstruction)"Siebel-Property-Set" = '';
Or, if you insist on using XMLNS,
Code:
Set OutputRoot.XMLNS.(XML.ProcessingInstruction)"Siebel-Property-Set" = '';
Back to top
View user's profile Send private message
vsethi007
PostPosted: Mon Apr 21, 2008 7:11 am    Post subject: Reply with quote

Novice

Joined: 17 Apr 2008
Posts: 19

Hi Everybody

Thanks so much for help
The approach told to me...

Set OutputRoot.XMLNS.(XML.ProcessingInstruction)"Siebel-Property-Set" = '';
it worked out well.

this will give me output like this <?Siebel-Property-Set ?>
But i need to create this complete tag <?Siebel-Property-Set EscapeNames = "true" ?>

so i changed the code like this..
Set OutputRoot.XML.(XML.ProcessingInstruction)"Siebel-Property-Set EscapeNames = ""true"" " = ''; to get the required output.

it gave me the output what i wanted,
Just need to know am I following the right method.

Thanks in advance
Vivek
Back to top
View user's profile Send private message
kimbert
PostPosted: Mon Apr 21, 2008 11:04 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

Your approach is fine.
I've made a mental note to improve the documentation about processing instructions when I get a chance.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Add header in 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.