Package org.apache.lenya.xml

Examples of org.apache.lenya.xml.Schema


        }
    }

    protected void validate(Document xml) throws Exception {
        ResourceType resourceType = getSourceDocument().getResourceType();
        Schema schema = resourceType.getSchema();
        ValidationUtil.validate(this.manager, xml, schema, new UsecaseErrorHandler(this));
    }
View Full Code Here


            Configuration schemaConf = config.getChild(ELEMENT_SCHEMA, false);

            if (schemaConf != null) {
                String uri = schemaConf.getAttribute(ATTRIBUTE_URI);
                String language = schemaConf.getAttribute(ATTRIBUTE_NAMESPACE);
                this.schema = new Schema(language, uri);
            }

            // determine the sample content locations.
            Configuration samplesFileConf = config.getChild(ELEMENT_SAMPLES, false);
            if (samplesFileConf != null) {
View Full Code Here

        }
    }

    protected void validate(Document xml) throws Exception {
        ResourceType resourceType = getSourceDocument().getResourceType();
        Schema schema = resourceType.getSchema();
        if (schema == null) {
            getLogger().info(
                    "No schema declared for resource type [" + resourceType.getName()
                            + "], skipping validation.");
        }
View Full Code Here

    }

    private void validateDoc(SourceResolver resolver, org.w3c.dom.Document xmlDoc, Document doc)
            throws Exception {
        ResourceType resourceType = doc.getResourceType();
        Schema schema = resourceType.getSchema();
        ValidationUtil.validate(this.manager, xmlDoc, schema, new UsecaseErrorHandler(this));
    }
View Full Code Here

            Configuration schemaConf = config.getChild(ELEMENT_SCHEMA, false);

            if (schemaConf != null) {
                String uri = schemaConf.getAttribute(ATTRIBUTE_URI);
                String language = schemaConf.getAttribute(ATTRIBUTE_NAMESPACE);
                this.schema = new Schema(language, uri);
            }

            // determine the sample content locations.
            Configuration samplesFileConf = config.getChild(ELEMENT_SAMPLES, false);
            if (samplesFileConf != null) {
View Full Code Here

        }
    }

    protected void validate(Document xml) throws Exception {
        ResourceType resourceType = getSourceDocument().getResourceType();
        Schema schema = resourceType.getSchema();
        ValidationUtil.validate(this.manager, xml, schema, new UsecaseErrorHandler(this));
    }
View Full Code Here

    }

    private void validateDoc(SourceResolver resolver, org.w3c.dom.Document xmlDoc, Document doc)
            throws Exception {
        ResourceType resourceType = doc.getResourceType();
        Schema schema = resourceType.getSchema();
        ValidationUtil.validate(this.manager, xmlDoc, schema, new UsecaseErrorHandler(this));
    }
View Full Code Here

        String sourceUri = getParameterAsString(SOURCE_URI);
        org.w3c.dom.Document xmlDoc = SourceUtil.readDOM(sourceUri, this.manager);

        ResourceType resourceType = sourceDoc.getResourceType();
        Schema schema = resourceType.getSchema();
        ValidationUtil.validate(this.manager, xmlDoc, schema, new UsecaseErrorHandler(this));

        if (!hasErrors()) {
            SourceUtil.writeDOM(xmlDoc, sourceDoc.getOutputStream());
            String event = getParameterAsString(EVENT, DEFAULT_EVENT);
View Full Code Here

        }
    }

    protected void validate(Document xml) throws Exception {
        ResourceType resourceType = getSourceDocument().getResourceType();
        Schema schema = resourceType.getSchema();
        ValidationUtil.validate(this.manager, xml, schema, new UsecaseErrorHandler(this));
    }
View Full Code Here

        }
    }

    protected void validate(String xmlString, String encoding) throws Exception {
        ResourceType resourceType = getSourceDocument().getResourceType();
        Schema schema = resourceType.getSchema();
        if (schema == null) {
            getLogger().info(
                    "No schema declared for resource type [" + resourceType.getName()
                            + "], skipping validation.");
        } else {
View Full Code Here

TOP

Related Classes of org.apache.lenya.xml.Schema

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.