Datastage is replacing < symbol as &lt in XML file

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
bunu1977
Participant
Posts: 35
Joined: Thu Oct 16, 2003 4:46 am

Datastage is replacing < symbol as &lt in XML file

Post by bunu1977 »

Hi,
I am creating a xml file thru datastage.
For one column I have appended a '<' symbol before the column value
When I am opening the file thru internet explorer, I can able to see < symbol before the column value.
But When I am opening the xml file in notepad, it is replacing the character as &lt
My requirement is when i open the file in notepad < symbol should appear before the column value

Can any one help me to find out the solution for this?
Dilip Das
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

They are equivalent and really shouldn't case a problem.

When you generate the XML Output, do you have the 'Data Element' column set to 'XML'? My understanding is that data element type is responsible for making those 'safe XML' substitutions. So, if it says XML make it blank... or perhaps vice-versa. Pretty sure that will solve your problem. Let us know! :wink:
-craig

"You can never have too many knives" -- Logan Nine Fingers
bunu1977
Participant
Posts: 35
Joined: Thu Oct 16, 2003 4:46 am

Hi

Post by bunu1977 »

Hi,
Ihave not selected the DataElements.
Let me try byselecting the DataElements as XML. I ll reply to you on Monday.


chulett wrote:They are equivalent and really shouldn't case a problem.

When you generate the XML Output, do you have the 'Data Element' column set to 'XML'? My understanding is that data element type is responsible for making those 'safe XML' substitutions. So, if it says XML make it blank... or perhaps vice-versa. Pretty sure that will solve your problem. Let us know! :wink:
Dilip Das
jzparad
Charter Member
Charter Member
Posts: 151
Joined: Thu Apr 01, 2004 9:37 pm

Post by jzparad »

I don't think this is a case of creating 'safe XML' substitutions. There are a number of reserved characters in XML and one of these is '<'. You cannot have one of these appearing in the data because any XML reader will interpret this as the start of a new tag. Hence they must be replaced with those special strings (<) in order to create form well-formed documents.

The fact that an XML reader such as Internet Explorer interprets the character correctly shows that it is correct. If you replaced this with an actual '<' character, you would find that XML readers would throw an error.

You need to sort out the requirements. Do you want a well-formed XML document or do you want a text document that looks a little bit like XML.
Jim Paradies
bunu1977
Participant
Posts: 35
Joined: Thu Oct 16, 2003 4:46 am

Post by bunu1977 »

Hi,
I have selected XML as Dataelement and it is working file.

Thanks
jzparad wrote:I don't think this is a case of creating 'safe XML' substitutions. There are a number of reserved characters in XML and one of these is '<'. You cannot have one of these appearing in the data because any XML reader will interpret this as the start of a new tag. Hence they must be replaced with those special strings (<) in order to create form well-formed documents.

The fact that an XML reader such as Internet Explorer interprets the character correctly shows that it is correct. If you replaced this with an actual '<' character, you would find that XML readers would throw an error.

You need to sort out the requirements. Do you want a well-formed XML document or do you want a text document that looks a little bit like XML.
Dilip Das
jzparad
Charter Member
Charter Member
Posts: 151
Joined: Thu Apr 01, 2004 9:37 pm

Post by jzparad »

I have selected XML as Dataelement and it is working file.
You're right in saying that this will achieve what you want. Basically, you're telling DataStage that this field contains a valid XML chunk so don't bother converting it.

My point however is that you no longer have a valid XML document. If you try to open that file in Internet Explorer, you will receive an error.

In any case, if this is truly your requirement, then it's OK!
Jim Paradies
bunu1977
Participant
Posts: 35
Joined: Thu Oct 16, 2003 4:46 am

Post by bunu1977 »

I can able to open the xml file in Internet Explorer without any error.
jzparad wrote:
I have selected XML as Dataelement and it is working file.
You're right in saying that this will achieve what you want. Basically, you're telling DataStage that this field contains a valid XML chunk so don't bother converting it.

My point however is that you no longer have a valid XML document. If you try to open that file in Internet Explorer, you will receive an error.

In any case, if this is truly your requirement, then it's OK!
Dilip Das
Post Reply