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 » XMLNSC parsing : empty tag problem

Post new topic  Reply to topic
 XMLNSC parsing : empty tag problem « View previous topic :: View next topic » 
Author Message
maanav_kr
PostPosted: Tue Mar 06, 2007 5:35 pm    Post subject: XMLNSC parsing : empty tag problem Reply with quote

Novice

Joined: 19 Jan 2007
Posts: 15

Hello,

Am using XMLNSC parsing for input messages.. message looks somethign like:

Code:

<?xml version="1.0" encoding="UTF-8"?>
<NS1:s_o xmlns:NS1="http://www.w3schools.com" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
   <NS1:mr_history_data>
      <NS1:abc></NS1:abc>
   </NS1:mr_history_data>
</NS1:s_o>



I want to validate if the tag abc is empty or has some content.

I assign the tag to a char string :

Code:
DECLARE ABC_file CHARACTER InputRoot.XMLNSC.NS1:s_o.NS1:mr_history_data.NS1:demand;


But then following code alway takes me to False :

Code:
if (ABC_file = '') then
         set Environment.de_if = 'TRUE';
      else
         set Environment.de_if = 'FALSE';
      end if;


I tried to trim, then checking length of ABC_file, I get 3.

Code:
set Environment.de_len=LENGTH(DEMAND_READING_file);


But cannt see anything in trace node except new line and tab / blank spaces

Code:
        (0x01000000)http://www.w3schools.com:abc =


Then i even assigned the value to new tag, stangely it has new line and tab or something

Code:
        (0x03000000)http://www.w3schools.com:remand = '

        '


If i use XML parsing, the IF ..ELSE works fine.. Can someone please let me know if any other equivalent is to be used?

Thanks,

Mk
Back to top
View user's profile Send private message
sarat
PostPosted: Tue Mar 06, 2007 11:41 pm    Post subject: Reply with quote

Centurion

Joined: 29 Jun 2005
Posts: 136
Location: India

Hi mundhrikottai,

Your i/p msg is

Quote:
<?xml version="1.0" encoding="UTF-8"?>
<NS1:s_o xmlns:NS1="http://www.w3schools.com" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<NS1:mr_history_data>
<NS1:abc></NS1:abc>
</NS1:mr_history_data>
</NS1:s_o>


and ur code is

Code:
DECLARE ABC_file CHARACTER InputRoot.XMLNSC.NS1:s_o.NS1:mr_history_data.NS1:demand;



But where's "demand" in the input?
_________________
With Regards,
Sarat.
Back to top
View user's profile Send private message
maanav_kr
PostPosted: Wed Mar 07, 2007 1:27 pm    Post subject: Reply with quote

Novice

Joined: 19 Jan 2007
Posts: 15

Hi sarat,

'demand' is actually 'abc'.. i renamed all occurences for the forum.. misssed this one.

Regards

Maanav
Back to top
View user's profile Send private message
sarat
PostPosted: Wed Mar 07, 2007 10:30 pm    Post subject: Reply with quote

Centurion

Joined: 29 Jun 2005
Posts: 136
Location: India

Its ok...

Yeah I've used ur code and input.

The ABC_file = \n not recognizing as null.

Tht's why

IF ABC_file = ' ' is always going to FALSE!!
_________________
With Regards,
Sarat.
Back to top
View user's profile Send private message
kimbert
PostPosted: Thu Mar 08, 2007 1:25 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

Looks as if you are hitting a known problem with XMLNSC. If you raise a PMR you can get an IFix for this. You should ask for a test fix for PMR 12211,999,866. Or you can wait for the next Fix Pack.
Back to top
View user's profile Send private message
Marek
PostPosted: Fri Mar 30, 2007 2:04 am    Post subject: Reply with quote

Apprentice

Joined: 30 Jun 2004
Posts: 32
Location: Edinburgh

In the example why assign the tag to a char string? I don't see the point in this. If you intend to refer to 'InputRootInputRoot.XMLNSC.NS1:s_o.NS1:mr_history_data' more often then from a readibility and efficeincy perspective a REFERENCE variable would be best...

Thanks for any clarification.
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 » XMLNSC parsing : empty tag problem
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.