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 » How to convert an XMLNSC message into String

Post new topic  Reply to topic
 How to convert an XMLNSC message into String « View previous topic :: View next topic » 
Author Message
phaniIIB
PostPosted: Wed Sep 09, 2015 5:50 am    Post subject: How to convert an XMLNSC message into String Reply with quote

Acolyte

Joined: 28 Jul 2015
Posts: 51

Can anyone suggest how to convert an XMLNSC message into String in Java compute node
Back to top
View user's profile Send private message
Vitor
PostPosted: Wed Sep 09, 2015 5:58 am    Post subject: Re: How to convert an XMLNSC message into String Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

phaniIIB wrote:
Can anyone suggest how to convert an XMLNSC message into String in Java compute node


Why on Earth would you want or need to?

Is it because your XPath still isn't working?
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
mqjeff
PostPosted: Wed Sep 09, 2015 6:03 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

By using the same method that converts any logical message tree into a serialized form.
_________________
chmod -R ugo-wx /
Back to top
View user's profile Send private message
phaniIIB
PostPosted: Wed Sep 09, 2015 6:14 am    Post subject: Reply with quote

Acolyte

Joined: 28 Jul 2015
Posts: 51

Because I wanted to trim the XML message as follows,

Code:
string.replace("\n"," ").replace("\r", " ").replaceAll("[\\t\\n\\r]+", "").trim().replaceAll(" +"," ");


The above code indicates trimming a string. Can you please suggest how to trim an XML message.

My thought was to convert an XML into string and perform the above task.
Back to top
View user's profile Send private message
smdavies99
PostPosted: Wed Sep 09, 2015 6:19 am    Post subject: Reply with quote

Jedi Council

Joined: 10 Feb 2003
Posts: 6076
Location: Somewhere over the Rainbow this side of Never-never land.

Does the XMLNSC parser not remove all that crud when it parses the input message?
So, are you sure that EACH and EVERY component of the message tree that you are dealing with has things like a CRLF at the end of it?
Just because the input message may have them in order to make them look pretty in some message viewers it dow not mean that they are there after the message has been parsed.

Has someone told you do this? If not how did you come to the conclusion that you need to this?

Remember that you are dealing with a message tree. This is why we tell java developers that Broker is not a J2EE server/engine.
_________________
WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995

Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions.


Last edited by smdavies99 on Wed Sep 09, 2015 6:21 am; edited 1 time in total
Back to top
View user's profile Send private message
mqjeff
PostPosted: Wed Sep 09, 2015 6:20 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

Why do you think you need to do this for an XML document?

The only reason an XML document would have these characters in it is if they were supposed to be there, for some value of 'supposed'.

If you did in fact trim these characters, you could actually end up damaging the business meaning of the document.

Go back to square one, and revisit your requirement and what format the data should come into your flow as.

Then revisit the notion that every thing inside a message flow is a logical message tree, and remember what you were taught about trees.
_________________
chmod -R ugo-wx /
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 » How to convert an XMLNSC message into String
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.