One Star

Error :The entity name must immediately follow the '&' in the entity r

Hi,
I am getting below error while loading xml file in a table
Exception in component tFileInputXML_1
org.dom4j.DocumentException: Error on line 15 of document : The entity name must immediately follow the '&' in the entity reference. Nested exception: The entity name must immediately follow the '&' in the entity reference.
at org.dom4j.io.SAXReader.read(SAXReader.java:482)
at org.dom4j.io.SAXReader.read(SAXReader.java:365)

Please help me.
2 REPLIES
Seventeen Stars

Re: Error :The entity name must immediately follow the '&' in the entity r

hi,
I think that you've got caracter "&" in some values.
It's a special caracter for Xml parser, and it expect the name of this pre-defined entity after that.
http://en.wikipedia.org/wiki/List_of_XML_and_HTML_character_entity_references#Predefined_entities_in...
"&" must be "&" to be valid.
try a replace with regex :
// value is the String to parse
value.replaceAll("&","&")

hope it helps
regards
laurent
One Star

Re: Error :The entity name must immediately follow the '&' in the entity r

Hi,
Please explain in Talend component based.
Thanks
Chin