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 » newline in a xml tag value

Post new topic  Reply to topic
 newline in a xml tag value « View previous topic :: View next topic » 
Author Message
ydsk
PostPosted: Wed Apr 04, 2007 7:31 am    Post subject: newline in a xml tag value Reply with quote

Chevalier

Joined: 23 May 2005
Posts: 410

Hi,

Is it possible to create a tag like <tag>AB \n CD</tag> , where \n is a newline ?

Not sure how the target system would interpret that but I am trying to know if such a thing is even possible in ESQL..

Pls reply.

thanks.
ydsk.
Back to top
View user's profile Send private message
Vitor
PostPosted: Wed Apr 04, 2007 7:39 am    Post subject: Reply with quote

Grand High Poobah

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

You'd need to include the \n as markup, in the same way if you need a < in an XML tag you'd need to mark it up as &lt.

There's a list of valid markup in the W3C XML standards doc.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Wed Apr 04, 2007 7:44 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

You can add a newline to any ESQL value by enclosing a newline in single-quotes.

Or you can cast the appropriate hex values to characters, and use that.

Vitor - newlines are not significant in XML, there's no entity for it.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
Vitor
PostPosted: Wed Apr 04, 2007 7:56 am    Post subject: Reply with quote

Grand High Poobah

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

jefflowrey wrote:
Vitor - newlines are not significant in XML, there's no entity for it.


No, you're right, they're not. You have to include them as hex values (&#A) if they're included.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Wed Apr 04, 2007 7:58 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

In element content, it's perfectly fine to use plain newlines (whatever one considers to be a plain newline).

One may or may not reasonably expect them to be preserved as such, however.

In element names, one should a) not use newlines, b) not expect them to be preserved.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
jsware
PostPosted: Wed Apr 04, 2007 8:49 am    Post subject: Reply with quote

Chevalier

Joined: 17 May 2001
Posts: 455

Vitor wrote:
You'd need to include the \n as markup, in the same way if you need a < in an XML tag you'd need to mark it up as &lt.

There's a list of valid markup in the W3C XML standards doc.

In ESQL you should be able to use something like:
Code:
set OutputRoot.XML.MyElement = '<';
And it gets marked up into:
Code:
<MyElement>&lt;</MyElement>
for you.

Lets not start the debate about XML being deprecated - pleeasse
_________________
Regards
John
The pain of low quaility far outlasts the joy of low price.
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 » newline in a xml tag value
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.