Package org.eclipse.xsd.util

Examples of org.eclipse.xsd.util.XSDResourceImpl


     */
    public static void serializeXSDSchema(XSDSchema schema, OutputStream output) {
//        try {
        //this seems to be how to save an XML Schema
        ResourceSet resourceSet = new ResourceSetImpl();
        Resource resource = new XSDResourceImpl(URI.createURI("file://D:/testing.xml"));
        resource.getContents().add(schema);
        resourceSet.getResources().add(resource);
        schema.validate();
        printDiagnostics(schema);
//            schema.eResource().save(output, null);
//        } catch (IOException e) {
View Full Code Here


            location = locationFile.getCanonicalFile().toURI().toString();
        }

        URI uri = URI.createURI(location);

        XSDResourceImpl xsdMainResource = (XSDResourceImpl) resourceSet.createResource(URI.createURI(
                    ".xsd"));
        xsdMainResource.setURI(uri);

        // schema building has effects on referenced schemas, it will alter them -> we need
        // to synchronize this call so that only one of these operations is active at any time
        synchronized(Schemas.class) {
            xsdMainResource.load(resourceSet.getLoadOptions());
            return xsdMainResource.getSchema();
        }
    }
View Full Code Here

     *            local name of type to check
     */
    @SuppressWarnings("unchecked")
    private static void checkChildElementTypes(String filename, String namespace, String name) {
        ResourceSet resourceSet = XSDSchemaImpl.createResourceSet();
        XSDResourceImpl resource = (XSDResourceImpl) resourceSet.getResource(
                URI.createURI(EmfXsdLoadTest.class.getResource(filename).toString()), true);
        XSDSchema schema = resource.getSchema();
        Assert.assertNotNull(schema);
        SchemaIndex index = null;
        XSDTypeDefinition type = null;
        try {
            index = new SchemaIndexImpl(new XSDSchema[] { schema });
View Full Code Here

TOP

Related Classes of org.eclipse.xsd.util.XSDResourceImpl

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.