Examples of ValidatingXMLStreamReader


Examples of org.apache.tuscany.sca.contribution.processor.ValidatingXMLStreamReader

        try {
           
            // Create a stream reader
            urlStream = url.openStream();
            XMLStreamReader reader = inputFactory.createXMLStreamReader(url.toString(), urlStream);
            reader = new ValidatingXMLStreamReader(reader, schema);
            reader.nextTag();
           
            // Read the constrainingType model
            ConstrainingType constrainingType = (ConstrainingType)extensionProcessor.read(reader);
View Full Code Here

Examples of org.apache.tuscany.sca.contribution.processor.ValidatingXMLStreamReader

        try {
           
            // Create a stream reader
            urlStream = url.openStream();
            XMLStreamReader reader = inputFactory.createXMLStreamReader(url.toString(), urlStream);
            reader = new ValidatingXMLStreamReader(reader, schema);
            reader.nextTag();
           
            // Reader the componentType model
            ComponentType componentType = (ComponentType)extensionProcessor.read(reader);
            if (componentType != null) {
View Full Code Here

Examples of org.apache.tuscany.sca.contribution.processor.ValidatingXMLStreamReader

        try {
           
            // Create a stream reader
            urlStream = url.openStream();
            XMLStreamReader reader = inputFactory.createXMLStreamReader(url.toString(), urlStream);
            reader = new ValidatingXMLStreamReader(reader, schema);
            reader.nextTag();
           
            // Read the composite model
            Composite composite = (Composite)extensionProcessor.read(reader);
            if (composite != null) {
View Full Code Here

Examples of org.apache.tuscany.sca.contribution.processor.ValidatingXMLStreamReader

    public SCADefinitions read(URL contributionURL, URI uri, URL url) throws ContributionReadException {
        InputStream urlStream = null;
        try {
            urlStream = url.openStream();
            XMLStreamReader reader = inputFactory.createXMLStreamReader(url.toString(), urlStream);
            reader = new ValidatingXMLStreamReader(reader, schema);
            reader.nextTag();
            SCADefinitions scaDefns = (SCADefinitions)extensionProcessor.read(reader);
           
            return scaDefns;
        } catch (XMLStreamException e) {
View Full Code Here

Examples of org.apache.xmlbeans.impl.validator.ValidatingXMLStreamReader

    public static void validateFiles(File[] instanceFiles,
                                     SchemaTypeLoader sLoader,
                                     final XmlOptions options)
    {
        final ValidatingXMLStreamReader vsr = new ValidatingXMLStreamReader();
        final Collection errors = new ArrayList();

        for (int i = 0; i < instanceFiles.length; i++) {
            final File file = instanceFiles[i];
            final String path = file.getPath();
            long time = 0;

            errors.clear();

            try {
                final FileInputStream fis = new FileInputStream(file);
                final XMLStreamReader rdr =
                    XML_INPUT_FACTORY.createXMLStreamReader(path, fis);

                //advance to first start element.
                while(!rdr.isStartElement()) {
                    rdr.next();
                }

                time = System.currentTimeMillis();
                vsr.init(rdr, true, null, sLoader, options, errors);

                while (vsr.hasNext()) {
                    vsr.next();
                }

                time = (System.currentTimeMillis() - time);
                vsr.close();
                fis.close();
            }
            catch (XMLStreamException xse) {
                final Location loc = xse.getLocation();
                XmlError e = XmlError.forLocation(xse.getMessage(), path,
View Full Code Here

Examples of org.apache.xmlbeans.impl.validator.ValidatingXMLStreamReader

    public static void validateFiles(File[] instanceFiles,
                                     SchemaTypeLoader sLoader,
                                     final XmlOptions options)
    {
        final ValidatingXMLStreamReader vsr = new ValidatingXMLStreamReader();
        final Collection errors = new ArrayList();

        for (int i = 0; i < instanceFiles.length; i++) {
            final File file = instanceFiles[i];
            final String path = file.getPath();
            long time = 0;

            errors.clear();

            try {
                final FileInputStream fis = new FileInputStream(file);
                final XMLStreamReader rdr =
                    XML_INPUT_FACTORY.createXMLStreamReader(path, fis);

                //advance to first start element.
                while(!rdr.isStartElement()) {
                    rdr.next();
                }

                time = System.currentTimeMillis();
                vsr.init(rdr, true, null, sLoader, options, errors);
               
                while (vsr.hasNext()) {
                    vsr.next();
                }

                time = (System.currentTimeMillis() - time);
                vsr.close();
                fis.close();
            }
            catch (XMLStreamException xse) {
                final Location loc = xse.getLocation();
                XmlError e = XmlError.forLocation(xse.getMessage(), path,
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.