cancel
Showing results for 
Search instead for 
Did you mean: 

Module Development for file validation.

park_saeiam
Explorer
0 Kudos

Dear all

I had try development the module to validate xml schema follow this

public void SAXValidation(InputStream tmpXML,InputStream tmpXSD,byte b1[]) throws Exception  {
		try {
		SAXParserFactory saxParserFactory = SAXParserFactory.newInstance();
		saxParserFactory.setNamespaceAware(true);
		saxParserFactory.setValidating(true);
		SAXParser saxParser = saxParserFactory.newSAXParser();
		saxParser.setProperty("http://java.sun.com/xml/jaxp/properties/schemaLanguage", "http://www.w3.org/2001/XMLSchema");
		saxParser.setProperty("http://java.sun.com/xml/jaxp/properties/schemaSource", tmpXSD);
		DefaultHandler handler = new DefaultHandler();
		saxParser.parse(tmpXML, handler);
		} 
		catch(Exception exc) {		
			CreateFile("i://xitest/test1/ValidationResult.txt",exc.toString());
		}

	}

But I got this error

org.xml.sax.SAXNotRecognizedException: Property: http://java.sun.com/xml/jaxp/properties/schemaLanguage

Could you please suggest?

Thanks

Park

Accepted Solutions (0)

Answers (6)

Answers (6)

Former Member
0 Kudos

Hi,

See the below links

/people/prasad.ulagappan2/blog/2005/06/08/sax-parser

/thread/60493 [original link is broken]

/thread/56141 [original link is broken]

Regards

Chilla

park_saeiam
Explorer
0 Kudos

Dear all

Thank you very much for your help. I'll try it. But however if anyone have the example code. Kindly please post to guide me.

Thanks

Park

henrique_pinto
Active Contributor
0 Kudos

Java code for xml schema validation in XI:

http://help.sap.com/saphelp_nw2004s/helpdata/en/c4/e1343e8c7f6329e10000000a114084/frameset.htm

Though it does declares the same properties as you did.

Kinda strange... which version/SP are you on?

Regards,

Henrique.

Former Member
0 Kudos

Hi Park,

Actually the SaxParser of SAP XI is not JAXP 1.2 compliant. Thus you get this error.

Try using an external JAXP 1.2 or above compatible class for this problem.

Former Member
0 Kudos

Hi Park,

you are getting org.xml.sax.SAXNotRecognizedException error because in statement:

<i>saxParser.setProperty("http://java.sun.com/xml/jaxp/properties/schemaLanguage", "http://www.w3.org/2001/XMLSchema");</i>

you are setting the http://java.sun.com/xml/jaxp/properties/schemaLanguage property the value http://www.w3.org/2001/XMLSchema.....but http://java.sun.com/xml/jaxp/properties/schemaLanguage cant be a property name......the property name can be schemaLanguage....

similarly http://java.sun.com/xml/jaxp/properties/schemaSource cant be a property name......schemaSource can be a property name.......

Thanks,

Rajeev Gupta

Shabarish_Nair
Active Contributor
0 Kudos

you can get the same document from [original link is broken]

without the service market place id. search for the document - How to Create Modules for the J2EE Adapter Engine

Former Member
0 Kudos
park_saeiam
Explorer
0 Kudos

Hi Chilla

Thanks for you help. But I can't get it. I got this page.

-


Error Message - ObjectID not existant

What happened?

ObjectID not found in R/3

What can you do?

Check your ObjectID

Error code: WEBSMP108-20070326140715-0014

Error details: 10021D7E-702/1A00C/3162-63F0CFB9-3CB9265-2992F9

Service Name: SAPIDB

Service Server: PWDF1736

Process-ID: 5012

Thread-ID: 5572

Sorry for any inconvenience.

Your SAP Service Marketplace Team

-


Thanks

Park

Former Member
0 Kudos

HI, to access this link you should have the Suserid and pwd

Regards

Chilla