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 field

Post new topic  Reply to topic
 Empty XML field « View previous topic :: View next topic » 
Author Message
WBI_user
PostPosted: Thu Oct 11, 2001 6:23 pm    Post subject: Reply with quote

Partisan

Joined: 07 Aug 2001
Posts: 386

I need to find out what is the value in MQSI
for an empty XML field. I cretaed a simple XML message
<TEST><DATA1>12</DATA1><DATA2></DATA2></test>
and a MRM definition
'testmsg' with 2 elements DATA1 and DATA2
In the compute node I have
SET OutputRoot.MRM.DATA1=InputRoot.XML.TEST.DATA1
SET OutputRoot.MRM.DATA2=InputRoot.XML.TEST.DATA2

I got an error saying unexpected NULL encountered for DATA2 filed and I think this is expected.

So I add an IF statement
IF InputRoot.XML.TEST.DATA2 is NULL THEN
SET OutputRoot.MRM.DATA2 = ' ';
But I got the same error. I ran the trace. The trace said that the statement
IF InputRoot.XML.TEST.DATA2 is NULL is evaluated to false.
I am confused.
Can some one tell me what is the value of an empty XML field (i.e. an XML field with just the begin tag and end tag).
I think it is NULL. But the trace said it is not. What is it ?
I need to find out how I can handle empty XML fields of an incoming XML message.
Back to top
View user's profile Send private message
Outdesign
PostPosted: Fri Oct 12, 2001 2:59 am    Post subject: Reply with quote

Apprentice

Joined: 16 Sep 2001
Posts: 38
Location: Hampshire, UK

In MQSI 'NULL' has multiple meanings ...

In this instance, a path reference to an element that does not exist will return NULL.

In your example the element does exist, but is an empty element.

-- Check if an element does not exist
IF InputRoot.XML.TEST.DATA2 IS NULL THEN
...

-- Check if an element is empty
-- Note, this is two single quotes with no space inbetween
IF InputRoot.XML.TEST.DATA2 = '' THEN
...
Back to top
View user's profile Send private message Visit poster's website
kwelch
PostPosted: Sat Oct 13, 2001 7:33 am    Post subject: Reply with quote

Master

Joined: 16 May 2001
Posts: 255

Thanks Kelvin and Outdesign! This is the answer that I was looking for in my prior post. I just want to clarify something though. Is <DATA2></DATA2> the same as <DATA2/> ? This is where you would check for = '' ? and if no DATA2 tags are present, the NULL check would be true?
Thanks for any clarification on this.

Karen
Back to top
View user's profile Send private message Send e-mail
Outdesign
PostPosted: Mon Oct 15, 2001 8:58 am    Post subject: Reply with quote

Apprentice

Joined: 16 Sep 2001
Posts: 38
Location: Hampshire, UK

Karen,

There are two forms of notation to represent an element which has no content
<empty></empty> and <empty/>

Hence, <DATA2></DATA2> and <DATA2/> are exactly the same.

And yes, you are correct about the empty element and non exist element checking.


[ This Message was edited by: Outdesign on 2001-10-15 09:59 ]
Back to top
View user's profile Send private message Visit poster's website
kwelch
PostPosted: Mon Oct 15, 2001 9:53 am    Post subject: Reply with quote

Master

Joined: 16 May 2001
Posts: 255

Outdesign,

Thank you for the clarification!
Where is this information documented? I searched in the MQSI docs I have and didn't find much.

Karen
Back to top
View user's profile Send private message Send e-mail
Outdesign
PostPosted: Tue Oct 16, 2001 2:37 am    Post subject: Reply with quote

Apprentice

Joined: 16 Sep 2001
Posts: 38
Location: Hampshire, UK

Karen,

This is an XML concept and *not* specific to MQSI.
I am not aware if this is explicitly documented in the MQSI manuals.

My reference sources were :
(1)
W3C Extensible Markup Language (XML) 1.0 (Second Edition) specification
http://www.w3.org/TR/2000/REC-xml-20001006#sec-starttags

(2)
The XML Companion, Second Edition by Neil Bradley,
Publisher Addison-Wesley, ISBN 0201674866

And I have used it successfully in my messageflows
Back to top
View user's profile Send private message Visit poster's website
kwelch
PostPosted: Tue Oct 23, 2001 9:58 am    Post subject: Reply with quote

Master

Joined: 16 May 2001
Posts: 255

Thanks. I will check out those references.

Karen
Back to top
View user's profile Send private message Send e-mail
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 field
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.