Page 1 of 1

Error: Xalan fatal error Expected entity name for reference

Posted: Mon May 27, 2013 6:31 am
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?

Posted: Mon May 27, 2013 8:15 am
by chulett
Yes. That error would imply that your XML is not well formed.

Posted: Mon May 27, 2013 11:30 am
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

Error: Xalan fatal error Expected entity name for reference

Posted: Tue May 28, 2013 12:07 am
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.

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

Posted: Tue May 28, 2013 2:14 am
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.

Posted: Tue May 28, 2013 4:44 am
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.

Posted: Tue May 28, 2013 5:17 am
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

Error: Xalan fatal error Expected entity name for reference

Posted: Thu Jun 20, 2013 4:57 am
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 ?

Posted: Thu Jun 20, 2013 5:30 am
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