Error: Xalan fatal error Expected entity name for reference

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
pqrabc
Participant
Posts: 20
Joined: Wed Nov 18, 2009 2:59 am

Error: Xalan fatal error Expected entity name for reference

Post by pqrabc »

Hi,

I have as server job that fetches data from .xml file using xml input stage. The job was running fine until today when I am facing the below error

Xalan fatal error (publicId: , systemId: , line: 146, column: 51): Expected entity name for reference

I searched through the forum but could not find relevant match, can someone please help ?Is something wrong with the . xml generated?
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Yes. That error would imply that your XML is not well formed.
-craig

"You can never have too many knives" -- Logan Nine Fingers
eostic
Premium Member
Premium Member
Posts: 3838
Joined: Mon Oct 17, 2005 9:34 am

Post by eostic »

Check carefully also how you are reading it....you should be using the folder stage to pick up the document. ---- if you are using the sequential Stage it is possible your job fails because of a stray CRLF in the midst of the document.

Ernie
Ernie Ostic

blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>
pqrabc
Participant
Posts: 20
Joined: Wed Nov 18, 2009 2:59 am

Error: Xalan fatal error Expected entity name for reference

Post by pqrabc »

Hi,

I am using a folder stage to input those .xml file.

How can we figure out that the .xml are not well generated?

The same code was working fine until yesterday.
pqrabc
Participant
Posts: 20
Joined: Wed Nov 18, 2009 2:59 am

Re: Error: Xalan fatal error Expected entity name for refere

Post by pqrabc »

Hi,

I searched the .xml files generated and noted that file generated for a job that aborted has extra characters within the message header as below:

<Run StartedAt="2013-05-28T03:57:16" CreationModel="DataStage8"
Message="(<Parent_Seq>) <- <Job_name>: Job under control finished." StatusCode="2" FinishedAt="2013-05-28T03:57:16">

The job which aborted is written in basic language.

Is the issue with these extra characters "<" ? Any idea why are these generated.
spoilt
Participant
Posts: 7
Joined: Mon Mar 25, 2013 7:17 am

Post by spoilt »

I think your XML file is exceeding the length you are using to read the data. Try to increase the lenght of XML file column or I think instead of reading whole file as a LongVarChar string. You can use option XML PATH/URL in folder and XML Stage.
eostic
Premium Member
Premium Member
Posts: 3838
Joined: Mon Oct 17, 2005 9:34 am

Post by eostic »

That's an interesting line of data..... hard to say if it is the cause of your problem, but if that's the xml that you are trying to read, the problem probably isn't the < --- it's the < and the > that _arent_ escaped as > and &lt ....this is text inside of an element called "Run".....

A good debugging trick is to just delete all the offensive < and > from a sample of your file and then try it again and see if that's the issue. Then you can figure out how to get rid of or avoid the offending string.

Ernie
Ernie Ostic

blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>
pqrabc
Participant
Posts: 20
Joined: Wed Nov 18, 2009 2:59 am

Error: Xalan fatal error Expected entity name for reference

Post by pqrabc »

Hi,

Sorry to post back on this topic. When I removed the file with extra characters '&lt', the code works fine.

Can anyone help ? Why is the extra character generated. How can we avoid that ?
eostic
Premium Member
Premium Member
Posts: 3838
Joined: Mon Oct 17, 2005 9:34 am

Post by eostic »

As noted above, < is an important part of xml ---- for whenever you have tag characters that might confuse a parser. It could be the problem but it also might be a red herring.

A better debugging technique, as noted above, is not to remove the file but "edit" it....... Remove just the &lt and test......then remove other parts and test.....

Then speak to whoever generates this xml to understand what they are doing and how/why they are getting offensive characters in the xml.

Ernie
Ernie Ostic

blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>
Post Reply