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 » Empty XML Tags

Post new topic  Reply to topic
 Empty XML Tags « View previous topic :: View next topic » 
Author Message
javaforvivek
PostPosted: Mon May 23, 2005 11:30 pm    Post subject: Empty XML Tags Reply with quote

Master

Joined: 14 Jun 2002
Posts: 282
Location: Pune,India

I have following input:
<Transaction>
<TotalAmount>67.89</TotalAmount>
<TotalVATAmount/>
</Transaction>

And I want following output:
<BusinessObject>
<Amount>67.89</Amount>
<VATAmount></VATAmount>
</BusinessObject>

I tried following:
I created two msg sets (Transaction and BusinessObject) with XML1 formats.
In my msg flow, MQInput Node sets parser to MRM and format to XML1 (so that I can validate the input msg).
Then use RCD to change the parser from MRM to XML.
Then is the mapping node to map Transaction to BusinessObject.
The output that I got is:
<BusinessObject>
<Amount>67.89</Amount>
<VATAmount>0</VATAmount>
</BusinessObject>

In my Transaction Msg Set, both TotalAmount and TotalVATAmount are local elements of type decimal.
Why does this extra '0' appears in my output <VATAmount>??
_________________
Vivek
------------------------------------------------------
...when you have eliminated the impossible, whatever remains, however improbable, must be the truth.
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
jefflowrey
PostPosted: Tue May 24, 2005 1:51 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

Is it a default value in your model?
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
javaforvivek
PostPosted: Tue May 24, 2005 1:53 am    Post subject: Reply with quote

Master

Joined: 14 Jun 2002
Posts: 282
Location: Pune,India

No. I haven't given any default value in my msg def.
Actually, when the msg enters the flow, the parser itself assigns the value of '0' to this element.
_________________
Vivek
------------------------------------------------------
...when you have eliminated the impossible, whatever remains, however improbable, must be the truth.
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
jefflowrey
PostPosted: Tue May 24, 2005 1:55 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

javaforvivek wrote:
No. I haven't given any default value in my msg def.
Actually, when the msg enters the flow, the parser itself assigns the value of '0' to this element.


Ah. So it's a Null Element rendering option.

You could play with that in your model, or you could add something to set the value of the element to null.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
javaforvivek
PostPosted: Tue May 24, 2005 2:03 am    Post subject: Reply with quote

Master

Joined: 14 Jun 2002
Posts: 282
Location: Pune,India

Have you encountered this problem earlier? Like, the parser assigns an unwanted value to an empty tag?
I had my flow in debug perspective and checked it. The tree looked like this:
Message
Properties
MQMD
MRM
TotalAmount = 67.89
TotalVATAmount = 0

From where does this zero come? I need to use MRM parser because I want to validate my input msg against the msg set.
Further I used mapping node to map input to output. Now I am planning to use compute node and build my output msg tree through ESQL code.
If you want I can email you my mxsd and you can check it.
_________________
Vivek
------------------------------------------------------
...when you have eliminated the impossible, whatever remains, however improbable, must be the truth.
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
jefflowrey
PostPosted: Tue May 24, 2005 3:28 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

The zero comes in because your model is set up to say "Replace null elements in input with 0" for the field in question.

http://publib.boulder.ibm.com/infocenter/wbihelp/index.jsp?topic=/com.ibm.etools.mft.doc/ad00791_.htm
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
javaforvivek
PostPosted: Tue May 24, 2005 4:17 am    Post subject: Reply with quote

Master

Joined: 14 Jun 2002
Posts: 282
Location: Pune,India

From your link I found following:
Quote:

The properties Encoding Null Num Val and Encoding Null Non-Num Val provide a value (if needed) to represent a null value. For an element of type string, this might be null or unspecified while for a number it might be 0 or 0.0.


In my msg set messageset.mset, I have created a physical format XML1.
In this I have following:
XML representation of null value
Encoding Numeric Null - NullEmpty
Encoding Numeric Null Value - disabled
Encoding Non-Numeric Null - NullEmpty
Encoding Non-Numeric Null Value - disabled

Now, where possibly do I have the value of 0 setup?
_________________
Vivek
------------------------------------------------------
...when you have eliminated the impossible, whatever remains, however improbable, must be the truth.
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Empty XML Tags
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.