Examples of XMLValidationSchema


Examples of org.codehaus.stax2.validation.XMLValidationSchema

        // to require the stax2 API no matter what.
        if (reader instanceof DepthXMLStreamReader) {
            reader = ((DepthXMLStreamReader)reader).getReader();
        }
        XMLStreamReader2 reader2 = (XMLStreamReader2)reader;
        XMLValidationSchema vs = getValidator(schemas);
        reader2.validateAgainst(vs);


    }
View Full Code Here

Examples of org.codehaus.stax2.validation.XMLValidationSchema

            inputSource.setSystemId(schemaSystemId);
            sources.put(schemaSystemId, inputSource);
        }
       
        W3CMultiSchemaFactory factory = new W3CMultiSchemaFactory();
        XMLValidationSchema vs;
        vs = factory.loadSchemas(sources);
        return vs;
    }
View Full Code Here

Examples of org.codehaus.stax2.validation.XMLValidationSchema

      // create a validator for the package.xml
      XMLValidationSchemaFactory validationSchemaFactory = XMLValidationSchemaFactory
            .newInstance(XMLValidationSchema.SCHEMA_ID_W3C_SCHEMA);
      // TODO: Is this good enough to get hold of package.xsd? Need to think about this.
      URL packageXsd = Thread.currentThread().getContextClassLoader().getResource("package.xsd");
      XMLValidationSchema schema = validationSchemaFactory.createSchema(packageXsd);;
      // enable validation (note: validation will happen during parse)
      xmlStreamReader.validateAgainst(schema);

      // parse the xml
      PackageType pkgMetadata = null;
View Full Code Here

Examples of org.codehaus.stax2.validation.XMLValidationSchema

        XMLStreamReader effectiveReader = reader;
        if (effectiveReader instanceof DepthXMLStreamReader) {
            effectiveReader = ((DepthXMLStreamReader)reader).getReader();
        }
        final XMLStreamReader2 reader2 = (XMLStreamReader2)effectiveReader;
        XMLValidationSchema vs = getValidator(serviceInfo);
        reader2.setValidationProblemHandler(new ValidationProblemHandler() {

            public void reportProblem(XMLValidationProblem problem) throws XMLValidationException {
                throw new Fault(new Message("READ_VALIDATION_ERROR", LOG, problem.getMessage()),
                                Fault.FAULT_CODE_CLIENT);
View Full Code Here

Examples of org.codehaus.stax2.validation.XMLValidationSchema

        reader2.validateAgainst(vs);
    }

    public void setupValidation(XMLStreamWriter writer, ServiceInfo serviceInfo) throws XMLStreamException {
        XMLStreamWriter2 writer2 = (XMLStreamWriter2)writer;
        XMLValidationSchema vs = getValidator(serviceInfo);
        writer2.setValidationProblemHandler(new ValidationProblemHandler() {

            public void reportProblem(XMLValidationProblem problem) throws XMLValidationException {
                throw new Fault(problem.getMessage(), LOG);
            }
View Full Code Here

Examples of org.codehaus.stax2.validation.XMLValidationSchema

            EmbeddedSchema embeddedSchema = new EmbeddedSchema(schemaSystemId, serialized);
            sources.put(sch.getTargetNamespace(), embeddedSchema);
        }

        W3CMultiSchemaFactory factory = new W3CMultiSchemaFactory();
        XMLValidationSchema vs;
        // I don't think that we need the baseURI.
        vs = factory.loadSchemas(null, sources);
        return vs;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.