Package org.exolab.castor.xml.schema.reader

Examples of org.exolab.castor.xml.schema.reader.SchemaReader


     * Sets the XML Schema to use. Parses and prepares the Schema.
     *
     * @param schemaURL URL string for XML Schema file.  */
    public void setSchema(final String schemaURL) throws DTXException {
        try {
            SchemaReader
                reader = new SchemaReader(new InputSource((new URL(schemaURL)).openStream()));
            _schema = reader.read();
        } catch (IOException iox) {
            throw new DTXException(iox);
        } catch (Exception e) {
            throw new DTXException(e);
        }
View Full Code Here


     * @return the Schema that was read in
     */
    private Schema testReadingSchema(final String url) {
        verbose("--> Reading XML Schema: " + url);
        try {
            SchemaReader reader = new SchemaReader();
           
            reader.setSchemaContext(new SchemaContextImpl());
            reader.setInputSource(new InputSource(url));
           
            Schema returnValue  = reader.read();
            if (_failure != null && _failure.getContent() && _failure.getFailureStep() != null &&
                 _failure.getFailureStep().equals(FailureStepType.PARSE_SCHEMA)) {
                fail("Reading/Parsing the schema was expected to fail, but succeeded");
            }
            return returnValue;
View Full Code Here

   {
      // create the sax input source
      InputSource inputSource = new InputSource(reader);

      // create the schema reader
      SchemaReader schemaReader = new SchemaReader(inputSource);
      schemaReader.setValidation(false);

      // read the schema from the source
      Schema schema = schemaReader.read();

      return schema;
   }
View Full Code Here

TOP

Related Classes of org.exolab.castor.xml.schema.reader.SchemaReader

Copyright © 2018 www.massapicom. 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.