0 Replies Latest reply: Aug 28, 2012 3:49 AM by 958397 RSS

    validation of xml agaist XSD in by using schemaValidate of oraxsd

    958397
      Hi,

      I am trying to validate an xml agaist xsd from pro*C wher i have oraxml and oraxsd libraries.

      I have used a method of oraxsd and it gives error 14. pLesa let me know why i am getting this eror and how i can validate an xml by using thses functions..

      int validateXSD()

      {

      xsdctx *ctx1;
      xmlctx *ctx ;
      uword ecode1 ;
      xmlnode *root;

           if(gold_debug)
                {          
                     printf("Validate XSD");               
                     fflush(stdout);
                }          
                
                root = getDocumentElement(ctx);          
                
                if(gold_debug)
                {          
                     printf("Validate XSD *****1 ");               
                     fflush(stdout);
                }
                
                ctx1 = schemaInitialize(ctx, &ecode1);          
                if (ctx1==0 ) {
                     fprintf(stderr,"XSD initialisation failed\n");
                     return 1;
                }
                
                if(ecode1 = schemaValidate(ctx1, root, (oratext *)xsdfile)) {
                
                if(gold_debug)
                     {          
                          printf("Validation failed, error %u\n", ecode1);               
                          fflush(stdout);
                     }               
                     return 1;
                }else{
                     if(gold_debug)
                     {          
                          printf("*******************Scheam Validation Success*****************");               
                          fflush(stdout);
                     }     
                }     
           
           schemaTerminate(ctx1);      


                return 0;
      }


      output is

      Validate XSD *****1
      Validation failed, error 14


      Thanks,
      Nisa