Examples of newSchema()


Examples of javax.xml.validation.SchemaFactory.newSchema()

                }
                return null;
            }
        });
       
        Schema schema = schemaFactory.newSchema(
                new Source[]{
                        new StreamSource(ClassLoaderUtils.getResourceAsStream("schemas/exc-c14n.xsd", WSSec.class)),
                        new StreamSource(ClassLoaderUtils.getResourceAsStream("schemas/xmldsig-core-schema.xsd", WSSec.class)),
                        new StreamSource(ClassLoaderUtils.getResourceAsStream("schemas/xenc-schema.xsd", WSSec.class)),
                        new StreamSource(ClassLoaderUtils.getResourceAsStream("schemas/xenc-schema-11.xsd", WSSec.class)),
View Full Code Here

Examples of javax.xml.validation.SchemaFactory.newSchema()

    public void validate(InputStream in, URL schemaUrl) throws Exception {
        SOAPModelBuilder builder = OMXMLBuilderFactory.createSOAPModelBuilder(in, "UTF-8");
        SOAPEnvelope envelope = builder.getSOAPEnvelope();
        OMElement bodyContent = envelope.getBody().getFirstElement();
        SchemaFactory schemaFactory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
        Schema schema = schemaFactory.newSchema(schemaUrl);
        Validator validator = schema.newValidator();
        validator.validate(bodyContent.getSAXSource(true));
    }
    // END SNIPPET: sax
   
View Full Code Here

Examples of javax.xml.validation.SchemaFactory.newSchema()

        OMMetaFactory mf = OMAbstractFactory.getMetaFactory(OMAbstractFactory.FEATURE_DOM);
        SOAPModelBuilder builder = OMXMLBuilderFactory.createSOAPModelBuilder(mf, in, "UTF-8");
        SOAPEnvelope envelope = builder.getSOAPEnvelope();
        OMElement bodyContent = envelope.getBody().getFirstElement();
        SchemaFactory schemaFactory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
        Schema schema = schemaFactory.newSchema(schemaUrl);
        Validator validator = schema.newValidator();
        validator.validate(new DOMSource((Element)bodyContent));
    }
    // END SNIPPET: dom
   
View Full Code Here

Examples of javax.xml.validation.SchemaFactory.newSchema()

     *             configuration requested.
     * @throws IOException If any IO errors occur.
     */
    public static Configuration create (final File schemaLocation, final File configFile, final String pTargetAddress) throws SAXException , ParserConfigurationException , IOException {
        final SchemaFactory schemaFactory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
        final Schema schema = schemaFactory.newSchema(schemaLocation);

        // create a validator for the document
        final Validator validator = schema.newValidator();

        final DocumentBuilderFactory domFactory = DocumentBuilderFactory.newInstance();
View Full Code Here

Examples of javax.xml.validation.SchemaFactory.newSchema()

     * @throws IOException If any IO errors occur.
     */
    private final Document parse (final File schemaLocation, final File configFile) throws ConfigurationException {
        try {
            final SchemaFactory schemaFactory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
            final Schema schema = schemaFactory.newSchema(schemaLocation);

            // create a validator for the document
            final Validator validator = schema.newValidator();

            final DocumentBuilderFactory domFactory = DocumentBuilderFactory.newInstance();
View Full Code Here

Examples of javax.xml.validation.SchemaFactory.newSchema()

      return schema;
    }

    SchemaFactory sf = SchemaFactory.newInstance( javax.xml.XMLConstants.W3C_XML_SCHEMA_NS_URI );
    try {
      schema = sf.newSchema( schemaUrl );
    }
    catch ( SAXException e ) {
      throw new XmlParsingException( "Unable to create schema for " + schemaName + ": " + e.getMessage(), e );
    }
    return schema;
View Full Code Here

Examples of javax.xml.validation.SchemaFactory.newSchema()

   public static void validate(final Node node, final String schemaFile) throws Exception
   {
      SchemaFactory factory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);

      Schema schema = factory.newSchema(findResource(schemaFile));
      Validator validator = schema.newValidator();

      // validate the DOM tree
      try
      {
View Full Code Here

Examples of javax.xml.validation.SchemaFactory.newSchema()

        private static Schema loadSchema() {
            SchemaFactory factory = SchemaFactory.newInstance("http://www.w3.org/2001/XMLSchema");
            try {
                URL url = KieModuleModel.class.getClassLoader().getResource("org/kie/api/kmodule.xsd");
                return factory.newSchema(url);
            } catch (SAXException ex ) {
                throw new RuntimeException( "Unable to load XSD", ex );
            }
        }
View Full Code Here

Examples of javax.xml.validation.SchemaFactory.newSchema()

      SchemaFactory factory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
      InputStream schemaStream = ResourceLoader.getResourceAsStream("nifty-1.3.xsd");
      try {
        Source schemaFile = new StreamSource(schemaStream);
        javax.xml.validation.Schema schema = factory.newSchema(schemaFile);
        javax.xml.validation.Validator validator = schema.newValidator();
        validator.validate(new DOMSource(document));
      } finally {
        schemaStream.close();
      }
View Full Code Here

Examples of javax.xml.validation.SchemaFactory.newSchema()

        private static Schema loadSchema() {
            SchemaFactory factory = SchemaFactory.newInstance("http://www.w3.org/2001/XMLSchema");
            try {
                URL url = KieModuleModel.class.getClassLoader().getResource("org/kie/api/kmodule.xsd");
                return factory.newSchema(url);
            } catch (SAXException ex ) {
                throw new RuntimeException( "Unable to load XSD", ex );
            }
        }
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.