cancel
Showing results for 
Search instead for 
Did you mean: 

SAX-parser and mapping on the XI

Former Member
0 Kudos

Helllo everybody,

I'm trying to map an xml-document using the SAX-parser.

I'm reading the data using an impustream. the problem is, while testing on the XI, the following message comes :

Creating Java mapping xmlDataExchangeSAPSample/XMLValidation

Loaded class xmlDataExchangeSAPSample.XMLValidation

Loaded class xmlDataExchangeSAPSample.myErrorHandler

Call method execute of the application Java mapping xmlDataExchangeSAPSample.XMLValidation

      • START APPLICATION TRACE ***

xxx implementierende Klasse Parserscom.sap.engine.lib.jaxp.SAXParserFactoryImpl

erstelltes Dokument aus in EDIFACTINTERCHANGE

Beginn Parsenjava.io.ByteArrayInputStream@1aa342a3

SAXException when parsing Generic Exception:

com.sap.engine.lib.xml.util.NestedException -> com.sap.engine.lib.xml.parser.ParserException -> java.io.IOException: Parsing an empty source. Root element expected!

      • END APPLICATION TRACE ***

Java mapping xmlDataExchangeSAPSample/XMLValidation completed. (execute() of xmlDataExchangeSAPSample.XMLValidation

Ausführung war erfolgreich.

10:18:14 Testende

the the Document ist generated :

"...erstelltes Dokument aus in EDIFACTINTERCHANGE.."

but the parser find an empty source.

do you have an idea what could be happening here?

Kind regards

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

HI,

It is showing IOException, so the problem is with source structure. Please check source structure is empty or its correpted.

Reward points if needful.

Thanks,

RamuV

former_member189354
Contributor
0 Kudos

Hi,

<<

xxx implementierende Klasse Parserscom.sap.engine.lib.jaxp.SAXParserFactoryImpl

erstelltes Dokument aus in EDIFACTINTERCHANGE

Beginn Parsenjava.io.ByteArrayInputStream@1aa342a3

SAXException when parsing Generic Exception:

com.sap.engine.lib.xml.util.NestedException -> com.sap.engine.lib.xml.parser.ParserException -> java.io.IOException: Parsing an empty source. Root element expected!

>>

This seems that u r trying parse a file rather than valid XML document..

Usually you will notice this problem when u r trying to parse a payload which is in txt format usually when u r using File Adapter message protocol as "FILE" instead of "FCC".

Usually SAX is an API Desinged to parse Valid XML Documents only.

If you want to do manipulations on NON XML data better to use Java.io.InputStream & OutputStream.

Regards,

Rao.Mallikarjuna

Former Member
0 Kudos

hi ,

your error is Parsing an empty source. Root element expected!

can you check your root element?.check weather it is present or empty filled.

Regards,

Sumit Gupta

Former Member
0 Kudos

is ur source structure with more than 1 node at the same level without a root element enveloping those