Skip to Content
avatar image
Former Member

Module Development for file validation.

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

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

6 Answers

  • avatar image
    Former Member
    Mar 26, 2007 at 12:04 PM
    Add comment
    10|10000 characters needed characters exceeded

  • Mar 26, 2007 at 12:21 PM

    you can get the same document from Exchange Infrastructure How-to Guides for SAP NetWeaver 2004 [original link is broken]

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

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Mar 26, 2007 at 12:35 PM

    Hi Park,

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

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

    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

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Mar 26, 2007 at 01:07 PM

    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.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Mar 28, 2007 at 03:47 AM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Mar 28, 2007 at 04:08 AM

    Hi,

    See the below links

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

    what is the meaning of the word "parser" in xml ?

    Parse xml with UDF

    /thread/60493 [original link is broken]

    /thread/56141 [original link is broken]

    Trying to use SAX Parser

    Where does DOM and SAX parser comes in picture....

    XI 2.0 Java Mapping Examples

    JAR file not getting created

    Regards

    Chilla

    Add comment
    10|10000 characters needed characters exceeded