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 » Howto get rid of white spaces in parsed XML

Post new topic  Reply to topic
 Howto get rid of white spaces in parsed XML « View previous topic :: View next topic » 
Author Message
ernest-ter.kuile
PostPosted: Mon Apr 28, 2003 9:24 am    Post subject: Howto get rid of white spaces in parsed XML Reply with quote

Apprentice

Joined: 13 May 2002
Posts: 49
Location: KLM Holland

I have a xml message
Code:
<?xml version="1.0"?>
<NOTOCMessage>
        <MessageText>
                <![CDATA[SPECIAL LOAD NOTIFICATION TO CAPTAIN  PREFLIGHT EDNO 1]]>
        </MessageText>
</NOTOCMessage>


Notice : the line in the middle is a CDATA element.

When parsed this looks like this :

Code:
  (0x1000010)XML        = (
    (0x5000018)XML          = (
      (0x6000011) = '1.0'
    )
    (0x1000000)NOTOCMessage = (
      (0x1000000)MessageText            = (
        (0x2000000) = '<LF>        '
        (0x2000001) = 'SPECIAL LOAD NOTIFICATION TO CAPTAIN  PREFLIGHT EDNO 1'
        (0x2000000) = '<LF>        '
      )
    )
  )


note: the <LF>s are edited in, they are obviously linefeeds

How can I access the line starting with SPECIAL ... without getting automatically the white spaces above and below ?

I Tryed :
- InputRoot.XML.NOTOCMessage.MessageText
but this includes whitspace
- InputRoot.XML.NOTOCMessage.MessageText.(XML.Content)
but this _only_ includes the first whitspace line.

As XML.Content is (0x2000000) while the line I want is declared to be (0x2000001), I actually expected this last result.

But then I cannot find (0x2000001) in the XML parser constants table.

Anybody know the way to do this ?

Cheers.
Back to top
View user's profile Send private message Visit poster's website
lillo
PostPosted: Mon Apr 28, 2003 11:16 pm    Post subject: Reply with quote

Master

Joined: 11 Sep 2001
Posts: 224

Try the following code:

Code:

DECLARE ref REFERENCE TO InputRoot.XML.NOTOCMessage.MessageText;
MOVE ref FIRSTCHILD TYPE 0x2000001


I haven´t try the code. But it should work. In ref you get what you want. Type TYPE option is availabe for WMQI 2.1 CSD2 or later.
_________________
Lillo
IBM Certified Specialist - WebSphere MQ
Back to top
View user's profile Send private message
ernest-ter.kuile
PostPosted: Mon Apr 28, 2003 11:57 pm    Post subject: Reply with quote

Apprentice

Joined: 13 May 2002
Posts: 49
Location: KLM Holland

lillo wrote:
Try the following code ...


I'll try that too, but from somebody else I got a far simpler answer

Code:
InputRoot.XML.NOTOCMessage.MessageText.(XML.CDataSection)


That seems to do the trick, even though CDataSection in the WMQI docs from csd2 is declared to be (0x6000040) and not (0x2000001)


but thanks,

Ernest.
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Howto get rid of white spaces in parsed 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.