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 » XML issue

Post new topic  Reply to topic
 XML issue « View previous topic :: View next topic » 
Author Message
Jonah3
PostPosted: Wed Aug 23, 2006 7:41 am    Post subject: XML issue Reply with quote

Newbie

Joined: 22 Aug 2006
Posts: 8

Some XML predefined entities & ' " <> will been replaced by &amp; ... automaticly.
How could I make messages keeping & <> ' " in literal form?
Because XML attribute value has legal ' > . I want to keep the original message format.
Back to top
View user's profile Send private message
Jonah3
PostPosted: Wed Aug 23, 2006 7:43 am    Post subject: Reply with quote

Newbie

Joined: 22 Aug 2006
Posts: 8

WBIMB + DataStageTX
Back to top
View user's profile Send private message
Vitor
PostPosted: Wed Aug 23, 2006 7:44 am    Post subject: Re: XML issue Reply with quote

Grand High Poobah

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

Jonah3 wrote:
Some XML predefined entities & ' " <> will been replaced by &amp; ... automaticly.
How could I make messages keeping & <> ' " in literal form?
Because XML attribute value has legal ' > . I want to keep the original message format.


AFAIK W3C standard forbids those characters except in CDATA sections. If they've been escaped into &amp, &lt, etc by the broker's parser they should be presented to the application as the original characters when parsed by it's XML parser.

What version of broker are you using?

Conflicting opinions welcomed.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
madi
PostPosted: Wed Aug 23, 2006 8:01 am    Post subject: Reply with quote

Chevalier

Joined: 17 Jan 2006
Posts: 475

i think there is way to escape these characters ....... i cannot find the information though .......... i know ive done it before ....... you will have to take the message in blob and convert it into a string ...... find the characters and escape them .

then you can change it back to xml and process it normally

will post more information if i can find any

--madi
Back to top
View user's profile Send private message
kimbert
PostPosted: Wed Aug 23, 2006 8:24 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

More details please.
1. What are you trying to do?
2. Where are you seeing these entities ( &amp; &gt; ...). In the message tree?
Back to top
View user's profile Send private message
Jonah3
PostPosted: Thu Aug 24, 2006 2:28 am    Post subject: Reply with quote

Newbie

Joined: 22 Aug 2006
Posts: 8

Message content : <A name="as'>ds"/>

Simple test flow:MQINPUT + ComputeNode + MQOUTPUT

Computernode just copy entire message.

Output is <A name="as'>ds"/>

Complex flow MQINPU + ComputeNode1+ DSTXNode+ ComputeNode2 +MQOUPUT

ComputeNode 1 code is

SET OutputRoot.BLOB.BLOB = CAST(InputRoot.XMLNS.*[] AS BLOB CCSID 1208 ENCODING MQENC_INTEGER_NORMAL);

ComputeNode 2 code is

DECLARE inputInfo CHARACTER CAST(InputRoot.BLOB.BLOB AS CHAR CCSID InputRoot.MQMD.CodedCharSetId ENCODING InputRoot.MQMD.Encoding);

CREATE LASTCHILD OF Environment DOMAIN('XMLNS') PARSE(transformedMSG,InputRoot.MQMD.Encoding,InputRoot.MQMD.CodedCharSetId);

Then output is
<A name="as&apos;&gt;ds"/>

I want to ask how to make ' > keep in literal form not replaced by WMB
Back to top
View user's profile Send private message
Vitor
PostPosted: Thu Aug 24, 2006 2:37 am    Post subject: Reply with quote

Grand High Poobah

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

What parses the output message? To put it another way, what is the parser used by the application that consumes the output XML? Is it objecting to the output XML with an error or similar, and in what way does it fail to recognise &lt as >?

Also, and to gain an insight into your requirment, why does the attribute contain these characters? I don't see at first glance what the attribute is trying to convey
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
Jonah3
PostPosted: Thu Aug 24, 2006 6:37 pm    Post subject: Reply with quote

Newbie

Joined: 22 Aug 2006
Posts: 8

Thank you all.

We have already known that & ' > < " in XML will been replaced by WMB.
It seems that WMB will handle it automaticly.
But a weird case that > has been replace by &gt; and ' not.
I have enquired IBM already.

Update you later

Thanks again
Back to top
View user's profile Send private message
Sridar
PostPosted: Sun Aug 27, 2006 9:31 pm    Post subject: Reply with quote

Acolyte

Joined: 14 May 2006
Posts: 72
Location: Chennai, India

Hi Jonah3

Any replies from IBM on this.
Though i did not face this problem am interested in knowing.
_________________
Thanks and Regards
Sridar
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Mon Aug 28, 2006 2:39 am    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

Jonah3 wrote:
Thank you all.

We have already known that & ' > < " in XML will been replaced by WMB.
It seems that WMB will handle it automaticly.
But a weird case that > has been replace by &gt; and ' not.
I have enquired IBM already.

Update you later

Thanks again

Standard w3 XML rules. No sign that would confuse the parser is allowed in the text. It will be escaped...
Your attribute text is 'a''>ds' => a&apos&gtds in standard xml on the wire.
Working as designed
Enjoy
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
kimbert
PostPosted: Mon Aug 28, 2006 5:47 pm    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

Quote:
Standard w3 XML rules
Is that strictly true? If I read this correctly http://www.w3.org/TR/2006/REC-xml-20060816/#syntax the escaping rules being applied are a little stricter than the standard requires. Most people won't mind that, but Jonah3 may have a valid requirement. Maybe an option on the parser would be useful?
Back to top
View user's profile Send private message
Jonah3
PostPosted: Mon Aug 28, 2006 11:47 pm    Post subject: Reply with quote

Newbie

Joined: 22 Aug 2006
Posts: 8

[quote="kimbert"]
Quote:
Maybe an option on the parser would be useful?


Any option on the parser ?
Back to top
View user's profile Send private message
Vitor
PostPosted: Tue Aug 29, 2006 12:31 am    Post subject: Reply with quote

Grand High Poobah

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

kimbert wrote:
Quote:
Standard w3 XML rules
Is that strictly true? If I read this correctly http://www.w3.org/TR/2006/REC-xml-20060816/#syntax the escaping rules being applied are a little stricter than the standard requires.


No, I think the current position is the correct one. This part of the specification seems (IMHO) unambiguous:

Quote:
The ampersand character (&) and the left angle bracket (<) MUST NOT appear in their literal form, except when used as markup delimiters, or within a comment, a processing instruction, or a CDATA section. If they are needed elsewhere, they MUST be escaped using either numeric character references or the strings " &amp; " and " &lt; " respectively. The right angle bracket (>) may be represented using the string " &gt; ", and MUST, for compatibility, be escaped using either " &gt; " or a character reference when it appears in the string " ]]> " in content, when that string is not marking the end of a CDATA section.


So unless these characters appear in a CDATA section or are being used as part of the XML document structure they must be escaped.

fjb_saper wrote:
Working as designed


I'm with you on this
_________________
Honesty is the best policy.
Insanity is the best defence.
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 » XML issue
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.