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 IndexWebSphere Message Broker (ACE) SupportHow to pass special character as it is...

Post new topicReply to topic Goto page 1, 2  Next
How to pass special character as it is... View previous topic :: View next topic
Author Message
satayoday
PostPosted: Mon Apr 20, 2009 1:13 am Post subject: How to pass special character as it is... Reply with quote

Novice

Joined: 27 May 2007
Posts: 22

Hi all,
I am extracting records from a database and creating an output xml file using MB comput node.
The problem is some of the records containing special character that that i need to pass them as it is .As xml does not support special character hence it is not opening.I am not sure which type of special character may come.I want to write code in which any special character can pass.

Thanks in advance.
Back to top
View user's profile Send private message Send e-mail
smdavies99
PostPosted: Mon Apr 20, 2009 1:29 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.

What type of DB field are you reading that has this 'special character' in it?
_________________
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.
Back to top
View user's profile Send private message
kimbert
PostPosted: Mon Apr 20, 2009 2:36 am Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

Quote:
As xml does not support special character hence it is not opening
Please define 'it' and 'opening'. We are not mind-readers!

Please provide an example of the output XML that you are getting, and another example showing what you would like to get.
Back to top
View user's profile Send private message
Vitor
PostPosted: Mon Apr 20, 2009 3:01 am Post subject: Re: How to pass special character as it is... Reply with quote

Grand High Poobah

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

satayoday wrote:
I want to write code in which any special character can pass.


Then you need to put all the database data in a CDATA section. This of course may cause a few problems for whoever's receiving your output XML.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
mqjeff
PostPosted: Mon Apr 20, 2009 3:26 am Post subject: Re: How to pass special character as it is... Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

Vitor wrote:
satayoday wrote:
I want to write code in which any special character can pass.


Then you need to put all the database data in a CDATA section.


Well, no. Not really.

CDATA Sections do not protect non-legal XML characters. Only some mapping from binary values to characters - perhaps in a 3 byte to 4 character scheme? - will do that.
Back to top
View user's profile Send private message
Vitor
PostPosted: Mon Apr 20, 2009 3:39 am Post subject: Re: How to pass special character as it is... Reply with quote

Grand High Poobah

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

mqjeff wrote:
Well, no. Not really.

CDATA Sections do not protect non-legal XML characters.


I've always thought that CDATA elements are unparsed (unlike PCDATA) and hence can contain any character / data element. So what happens to a non-legal XML character in a CDATA section?

Of course, I'm not even talking about different character sets in this context.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
mqjeff
PostPosted: Mon Apr 20, 2009 3:48 am Post subject: Re: How to pass special character as it is... Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

Vitor wrote:
mqjeff wrote:
Well, no. Not really.

CDATA Sections do not protect non-legal XML characters.


I've always thought that CDATA elements are unparsed (unlike PCDATA) and hence can contain any character / data element. So what happens to a non-legal XML character in a CDATA section?

Of course, I'm not even talking about different character sets in this context.


The XML parse on the document fails, the same as it would with a non-legal XML character anywhere else.

CDATA sections have to be parsable enough for the XML parser to find the end tag, just like the entire XML document has to be parseable enough for the parser to find the closing tag for the root element.
Back to top
View user's profile Send private message
Vitor
PostPosted: Mon Apr 20, 2009 4:04 am Post subject: Re: How to pass special character as it is... Reply with quote

Grand High Poobah

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

mqjeff wrote:
The XML parse on the document fails, the same as it would with a non-legal XML character anywhere else.


Weird. My copy of XMLSpy says my quickly-knocked up XML document with an assortment of control characters and packd numbers in a CDATA is well formed.

mqjeff wrote:
CDATA sections have to be parsable enough for the XML parser to find the end tag, just like the entire XML document has to be parseable enough for the parser to find the closing tag for the root element.


I grant you that such a section can't contain the characters for a CDATA end tag, so the parser can find that sequence.

Investigation (or fiddling round) continues.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
mqjeff
PostPosted: Mon Apr 20, 2009 4:14 am Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

CDATA sections are officially allowed to hold "Characters", as defined at http://www.w3.org/TR/xml11/#NT-Char
Back to top
View user's profile Send private message
Vitor
PostPosted: Mon Apr 20, 2009 4:50 am Post subject: Reply with quote

Grand High Poobah

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

You don't get parsers the way you used to....
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
kimbert
PostPosted: Mon Apr 20, 2009 11:30 am Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

In my experience, very few people 'get' parsers at all
Most think that parsing must be easy, just because their own brain is so effortlessly excellent at it.
Back to top
View user's profile Send private message
satayoday
PostPosted: Mon Apr 20, 2009 8:45 pm Post subject: What type of DB field are you reading that has this 'special Reply with quote

Novice

Joined: 27 May 2007
Posts: 22

I am accessing DB2 database with column field type character having those special character
Back to top
View user's profile Send private message Send e-mail
smdavies99
PostPosted: Mon Apr 20, 2009 9:28 pm Post subject: Reply with quote

Jedi Council

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

You still have not given us an idea what this special character is.....
_________________
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.
Back to top
View user's profile Send private message
satayoday
PostPosted: Mon Apr 20, 2009 9:35 pm Post subject: You still have not given us an idea what this special charac Reply with quote

Novice

Joined: 27 May 2007
Posts: 22

I am getting the below mentioned special characters
Plössl ,Large 2 Metal ,& etc

The xml tags like this giving problem

<Manufacturer>10mm Plössl Eyepiece</Manufacturer>
Back to top
View user's profile Send private message Send e-mail
kimbert
PostPosted: Tue Apr 21, 2009 12:12 am Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

Quote:
The xml tags like this giving problem
You still have not explained what the problem is. Please see my previous answer, and provide the information that I requested.
Back to top
View user's profile Send private message
Display posts from previous:
Post new topicReply to topic Goto page 1, 2  Next Page 1 of 2

MQSeries.net Forum IndexWebSphere Message Broker (ACE) SupportHow to pass special character as it is...
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.