Examples of XmlSchemaCollection


Examples of org.apache.axis.xsd.xml.schema.XmlSchemaCollection

            WSDLExtensibilityElement extensiblityElt = null;

            for (int i = 0; i < typesArray.size(); i++) {
                extensiblityElt = (WSDLExtensibilityElement) typesArray.get(i);
                Vector xmlObjectsVector = new Vector();
                XmlSchemaCollection schemaColl = new XmlSchemaCollection();
                Schema schema = null;

                if (ExtensionConstants.SCHEMA.equals(extensiblityElt.getType())) {
                    schema = (Schema) extensiblityElt;
                    Map inScopeNS = configuration.getWom().getNamespaces();
                    for (Iterator it = inScopeNS.keySet().iterator(); it.hasNext();) {
                        String prefix = (String) it.next();
                        schemaColl.mapNamespace(prefix,
                                                (String)inScopeNS.get(prefix));
                    }

                    Stack importedSchemaStack = schema.getImportedSchemaStack();
                    //compile these schemas
                    while (!importedSchemaStack.isEmpty()) {
                        Element el = ((javax.wsdl.extensions.schema.Schema)importedSchemaStack.pop()).getElement();
                        XmlSchema thisSchema = schemaColl.read(el);
                        xmlObjectsVector.add(thisSchema);
                    }
                }

                //create the type mapper
View Full Code Here

Examples of org.apache.ws.commons.schema.XmlSchemaCollection

         * </element> </sequence> </complexType> </schema>
         */

        QName elementQName = new QName("http://soapinterop.org/types", "constraintTest");
        InputStream is = new FileInputStream(Resources.asURI("constraints.xsd"));
        XmlSchemaCollection schemaCol = new XmlSchemaCollection();
        schemaCol.read(new StreamSource(is));

        XmlSchemaElement elem = schemaCol.getElementByQName(elementQName);
        assertNotNull(elem);
        assertEquals("constraintTest", elem.getName());
        assertEquals(new QName("http://soapinterop.org/types", "constraintTest"), elem.getQName());

        List<XmlSchemaIdentityConstraint> c = elem.getConstraints();
View Full Code Here

Examples of org.apache.ws.commons.schema.XmlSchemaCollection

        // create a DOM document
        DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance();
        documentBuilderFactory.setNamespaceAware(true);
        Document doc = documentBuilderFactory.newDocumentBuilder().parse(Resources.asURI("importBase.xsd"));

        XmlSchemaCollection schemaCol = new XmlSchemaCollection();
        schemaCol.setBaseUri(Resources.TEST_RESOURCES);
        XmlSchema schema = schemaCol.read(doc, null);
        assertNotNull(schema);

        // attempt with slash now
        schemaCol = new XmlSchemaCollection();
        schemaCol.setBaseUri(Resources.TEST_RESOURCES + "/");
        schema = schemaCol.read(doc, null);
        assertNotNull(schema);
    }
View Full Code Here

Examples of org.apache.ws.commons.schema.XmlSchemaCollection

        // create a DOM document
        DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance();
        documentBuilderFactory.setNamespaceAware(true);
        Document doc = documentBuilderFactory.newDocumentBuilder().parse(file.toURI().toURL().toString());

        XmlSchemaCollection schemaCol = new XmlSchemaCollection();
        XmlSchema schema = schemaCol.read(doc, file.toURI().toURL().toString());
        assertNotNull(schema);

    }
View Full Code Here

Examples of org.apache.ws.commons.schema.XmlSchemaCollection

        // create a DOM document
        DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance();
        documentBuilderFactory.setNamespaceAware(true);
        Document doc = documentBuilderFactory.newDocumentBuilder().parse(file.toURI().toURL().toString());

        XmlSchemaCollection schemaCol = new XmlSchemaCollection();
        XmlSchema schema = schemaCol.read(doc, file.toURI().toURL().toString());
        assertNotNull(schema);

        assertNotNull(schema.getTypeByName(new QName("http://soapinterop.org/xsd2", "SOAPStruct")));
        assertNotNull(schema.getElementByName(new QName("http://soapinterop.org/xsd2", "SOAPWrapper")));
    }
View Full Code Here

Examples of org.apache.ws.commons.schema.XmlSchemaCollection

     * Tests that imports without <tt>schemaLocation</tt> are resolved if the corresponding schemas
     * have been registered using {@link XmlSchemaCollection#getKnownNamespaceMap()}.
     */
    @Test
    public void testImportWithKnownNamespace() {
        XmlSchemaCollection schemaCol = new XmlSchemaCollection();
        schemaCol.getKnownNamespaceMap().put("http://www.w3.org/XML/1998/namespace",
                new XmlSchemaCollection().read(new InputSource(Resources.asURI("xml.xsd"))));
        XmlSchema schema = schemaCol.read(new InputSource(Resources.asURI("knownNamespace.xsd")));
        List<XmlSchemaExternal> externals = schema.getExternals();
        assertEquals(1, externals.size());
        XmlSchemaImport schemaImport = (XmlSchemaImport)externals.get(0);
        assertEquals("http://www.w3.org/XML/1998/namespace", schemaImport.getNamespace());
        XmlSchema schema2 = schemaImport.getSchema();
View Full Code Here

Examples of org.apache.ws.commons.schema.XmlSchemaCollection

    public WSDLASTVisitor(String tns)
        throws WSDLException, JAXBException {
       
        createWsdlDefinition(tns);
       
        schemas = new XmlSchemaCollection();
        schema = new XmlSchema(definition.getTargetNamespace(), schemas);
       
        addAnyType();
       
        createCorbaTypeMap();
View Full Code Here

Examples of org.apache.ws.commons.schema.XmlSchemaCollection

        definition = manager.createWSDLDefinition(tns);
       
        inheritScopeMap = new TreeMap<Scope, List<Scope>>();

        targetNamespace = tns;
        schemas = new XmlSchemaCollection();
        scopedNames = new ScopeNameCollection();
        deferredActions = new DeferredActionCollection();

        if (schemans == null) {
            schemans = tns;
View Full Code Here

Examples of org.apache.ws.commons.schema.XmlSchemaCollection

    }
   
    private XmlSchemaCollection schemaCollection;
   
    public SchemaCollection() {
        this(new XmlSchemaCollection());
    }
View Full Code Here

Examples of org.apache.ws.commons.schema.XmlSchemaCollection

public class CommonsXsdSchemaTest extends AbstractXsdSchemaTestCase {

    @Override
    protected XsdSchema createSchema(Resource resource) throws Exception {
        XmlSchemaCollection schemaCollection = new XmlSchemaCollection();
        XmlSchema schema = schemaCollection.read(SaxUtils.createInputSource(resource));
        return new CommonsXsdSchema(schema);
    }
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.