Author |
Message
|
vedbhat |
Posted: Thu Jul 27, 2006 12:35 am Post subject: Special Character after XML Tags |
|
|
 Disciple
Joined: 19 Mar 2002 Posts: 186 Location: Singapore
|
Hi,
Below is the code to copy the Message Header and Environment tree to Output Message. After Coping and coming out of Compute Node, I see Special Characters (Carriage Return, New Line Character after every Tag).
I am not sure how and why is it getting generated. Anyway to suppress this. Any help would be appreciated.
-----------------------
CALL CopyMessageHeaders(); -- Invoking standard Copy Header Routine
DECLARE tagName CHAR 'CommentAddRq';
...
...
...
...
SET OutputRoot.XML.{tagName}.*[] = Environment.CIM.BankSvc.HostReqData.{tagName}.*[];
----------------------
Thanks in advance,
Ved _________________ IBM Certified Solutions Expert - MQSeries Workflow
IBM Certified Specialist - MQSeries |
|
Back to top |
|
 |
vedbhat |
Posted: Fri Jul 28, 2006 12:48 am Post subject: |
|
|
 Disciple
Joined: 19 Mar 2002 Posts: 186 Location: Singapore
|
If the Input Message is in the Format shown below and after parsing the message, as XML in the input node, the indentatation is saved (Tabs and Line Feeds) as follows:
<?xml version="1.0"?>
<!DOCTYPE Order SYSTEM "Order.dtd">
<Order>
<ItemNo>1</ItemNo>
<Quantity>2</Quantity>
</Order>
Problem - I am trying to copy the input XML tree from Output during which the indentation also gets copied. Is there any way to suppress or tell the parser to copy only XML.Elements/XML.Tags and not to copy XML.Whitespace.
Any views.
Thanks,
Ved _________________ IBM Certified Solutions Expert - MQSeries Workflow
IBM Certified Specialist - MQSeries |
|
Back to top |
|
 |
elvis_gn |
Posted: Fri Jul 28, 2006 1:29 am Post subject: |
|
|
 Padawan
Joined: 08 Oct 2004 Posts: 1905 Location: Dubai
|
Hi vedbhat,
What tool are using to view these whitespaces ?
During debug, right before output are u seeing "\n" fields between the actual message fields ?
Please view your output in RFHUtil as char and tell us what u see...post it here too...
Regards. |
|
Back to top |
|
 |
kimbert |
Posted: Fri Jul 28, 2006 2:56 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
Quote: |
Is there any way to suppress or tell the parser to copy only XML.Elements/XML.Tags and not to copy XML.Whitespace. |
You've got a couple of options.
a) Walk the message tree (using a reference, of course) and remove all the whitespace nodes
b) Use the MRM XML format, which discards whitespace automatically ( but performance is not as good).
You don't say which domain you are using to parse your message, by the way. |
|
Back to top |
|
 |
mgk |
Posted: Fri Jul 28, 2006 5:33 am Post subject: |
|
|
 Padawan
Joined: 31 Jul 2003 Posts: 1642
|
If you are using MB V6 then you can use the XMLNSC domain which also throws away whitespace.
Regards, _________________ MGK
The postings I make on this site are my own and don't necessarily represent IBM's positions, strategies or opinions. |
|
Back to top |
|
 |
kimbert |
Posted: Fri Jul 28, 2006 5:47 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
Good point. That's by far the best of the three options. I assumed that anyone who was on v6 would automatically be using XMLNSC. |
|
Back to top |
|
 |
|