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 » Opaque parsing

Post new topic  Reply to topic
 Opaque parsing « View previous topic :: View next topic » 
Author Message
paustin_ours
PostPosted: Thu Jun 13, 2013 12:57 am    Post subject: Opaque parsing Reply with quote

Yatiri

Joined: 19 May 2004
Posts: 667
Location: columbus,oh

i have a incoming xml that i believe has some non unicode data in the cdata section that causes xml parser errors while parsing

i thought of using opque parsing for that tag that has the cdata

i set the opaque element to be

//customerData

I am still getting the error

An XML parsing error ''An invalid XML character (Unicode: 0x0) was found in the CDATA section.'' occurred on line 1 column 327 when parsing element ''/Root/XMLNSC/customer/customerData''.

not sure what i am missing. Please help. Thanks.[/u]
Back to top
View user's profile Send private message Yahoo Messenger
Esa
PostPosted: Thu Jun 13, 2013 1:03 am    Post subject: Reply with quote

Grand Master

Joined: 22 May 2008
Posts: 1387
Location: Finland

Even an opaque element is parsed. The parser just dont build a message tree for it. Setting the element to opaque doesn't help if the element contains invalid XML.
Back to top
View user's profile Send private message
cociu_2012
PostPosted: Thu Jun 13, 2013 1:07 am    Post subject: Re: Opaque parsing Reply with quote

Acolyte

Joined: 06 Jan 2012
Posts: 72

paustin_ours wrote:
i have a incoming xml that i believe has some non unicode data in the cdata section that causes xml parser errors while parsing

i thought of using opque parsing for that tag that has the cdata

i set the opaque element to be

//customerData

I am still getting the error

An XML parsing error ''An invalid XML character (Unicode: 0x0) was found in the CDATA section.'' occurred on line 1 column 327 when parsing element ''/Root/XMLNSC/customer/customerData''.

not sure what i am missing. Please help. Thanks.[/u]

Are you sure you're not having one of these situations:
Quote:

Do not parse an element opaquely in any of the following cases:

The message flow must access one of its child elements.
The message flow changes the namespace prefix in a way that affects the opaque element or one of its child elements and the element is to be copied to the output bit stream.
The element, or any child element, contains a reference to an internal entity that is defined in an inline DTD and the element is to be copied to the output bit stream.
The element contains child attributes that have default values that are defined in an inline DTD and the element is to be copied to the output bit stream.


Also pot the debug trace. Don't use the visual one.
Back to top
View user's profile Send private message
paustin_ours
PostPosted: Thu Jun 13, 2013 1:36 am    Post subject: Reply with quote

Yatiri

Joined: 19 May 2004
Posts: 667
Location: columbus,oh

Esa wrote:
Even an opaque element is parsed. The parser just dont build a message tree for it. Setting the element to opaque doesn't help if the element contains invalid XML.


Is there a way to get around this problem?
Back to top
View user's profile Send private message Yahoo Messenger
cociu_2012
PostPosted: Thu Jun 13, 2013 2:01 am    Post subject: Reply with quote

Acolyte

Joined: 06 Jan 2012
Posts: 72

paustin_ours wrote:

Is there a way to get around this problem?


Don't parse. Get rid of the invalid elements (escape, remove, comment), then parse.

And notice that this is a workarround. Consumers/app's should no send invalid payloads at any time.
Back to top
View user's profile Send private message
Esa
PostPosted: Thu Jun 13, 2013 2:01 am    Post subject: Reply with quote

Grand Master

Joined: 22 May 2008
Posts: 1387
Location: Finland

Yes. You can to preprocess the message as a BLOB and use for example regular expressions to remove the offending character.
Back to top
View user's profile Send private message
kimbert
PostPosted: Thu Jun 13, 2013 8:22 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

It is not a 'non-Unicode' character. It is simply a character that is not allowed within an XML document. The application that wrote that XML document is at fault.

Your choices are:
- fix the source application so that it sends correct XML
or
- parse in the BLOB domain and remove any nulls before parsing with XMLNSC.
Back to top
View user's profile Send private message
rekarm01
PostPosted: Thu Jun 13, 2013 9:34 am    Post subject: Re: Opaque parsing Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 1415

paustin_ours wrote:
An XML parsing error ''An invalid XML character (Unicode: 0x0) was found in the CDATA section.'' occurred on line 1 column 327 when parsing element ''/Root/XMLNSC/customer/customerData''.

If the CDATA section is supposed to contain non-character data, then the application should apply some sort of binary-to-text encoding, such as Base64 or HexBinary, before putting it in an XML message.
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 » Opaque parsing
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.