Examples of XSDParser


Examples of org.eclipse.xsd.util.XSDParser

        Reader reader = null;
        InputStream stream = null;
        try {
            // Parse the XSD, measuring the number of bytes as we read ...
            Map<?, ?> options = new HashMap<Object, Object>();
            XSDParser parser = new XSDParser(options);
            AtomicLong contentSize = new AtomicLong();
            if (source.getCharacterStream() != null) {
                reader = new SizeMeasuringReader(source.getCharacterStream(), contentSize);
                source = new InputSource(reader);
            } else {
                stream = new SizeMeasuringInputStream(source.getByteStream(), contentSize);
                source = new InputSource(stream);
            }
            parser.parse(source);

            // Get some metadata about the XSD ...
            String encoding = parser.getEncoding();

            // Convert the XSD to content ...
            XSDSchema schema = parser.getSchema();
            process(schema, encoding, contentSize.get(), outputNode);

        } finally {
            try {
                if (reader != null) reader.close();
View Full Code Here

Examples of org.eclipse.xsd.util.XSDParser

                + "              targetNamespace=\"http://localhost//test\">"
                + "  <xsd:element name=\"" + name + "\" type=\"xsd:" + original.getLocalPart()
                + "\"/>" + "</xsd:schema>");

            URL url = temp.toURL();
            XSDParser parser = new XSDParser();
            parser.parse(url.toString());

            XSDSchema schema = parser.getSchema();
            Map map = schema.getSimpleTypeIdMap();

            return (ElementInstance) map.get(name);
        } catch (Throwable t) {
            t.printStackTrace();
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.