Examples of GrammarWriter


Examples of com.sun.msv.writer.GrammarWriter

            if (source == null)
                fail("failed to parse the original grammar"); // unexpected result

            // then convert it to the target grammar,
            // and parse it by the target grammar reader parser.
            GrammarWriter writer = getWriter();

            // serialize it into the XML representation
            ByteArrayOutputStream baos = new ByteArrayOutputStream();
            writer.setDocumentHandler(new XMLSerializer(baos, new OutputFormat("xml", null, true)));
            writer.write(source.asGrammar());

            // then parse it again
            schema = secondValidator.parseSchema(new ByteArrayInputStream(baos.toByteArray()));
            if (schema == null)
                fail("conversion failed"); // unexpected result
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.