Examples of XmlSchemaCollection


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

    /**
     * @see org.apache.tuscany.sca.interfacedef.wsdl.WSDLDefinition#getXmlSchemaElement(javax.xml.namespace.QName)
     */
    public XmlSchemaElement getXmlSchemaElement(QName name) {
        XmlSchemaCollection schemaCollection = null;
        for (XSDefinition xsd : schemas) {
            if (schemaCollection == null && xsd.getSchemaCollection() != null) {
                schemaCollection = xsd.getSchemaCollection();
            }
            XmlSchemaElement element = xsd.getXmlSchemaElement(name);
            if (element != null) {
                return element;
            }
        }
        if (schemaCollection != null) {
           XmlSchemaElement element = schemaCollection.getElementByQName(name);
           if ( element != null) {
             return element;
           }
        }
       
View Full Code Here

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

    /**
     * @see org.apache.tuscany.sca.interfacedef.wsdl.WSDLDefinition#getXmlSchemaType(javax.xml.namespace.QName)
     */
    public XmlSchemaType getXmlSchemaType(QName name) {
        XmlSchemaCollection schemaCollection = null;
        for (XSDefinition xsd : schemas) {
            if (xsd.getSchemaCollection() != null) {
                schemaCollection = xsd.getSchemaCollection();
            }
            XmlSchemaType type = xsd.getXmlSchemaType(name);
            if (type != null) {
                return type;
            }
        }
        if (schemaCollection != null) {
            XmlSchemaType type = schemaCollection.getTypeByQName(name);
            if ( type != null ) {
              return type;
            }
        }
       
View Full Code Here

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

    private Map<String, List<XSDefinition>> map = new HashMap<String, List<XSDefinition>>();
    private XmlSchemaCollection schemaCollection;

    public XSDModelResolver(Contribution contribution, FactoryExtensionPoint modelFactories) {
        this.contribution = contribution;
        this.schemaCollection = new XmlSchemaCollection();
        this.factory = new DefaultXSDFactory();
    }
View Full Code Here

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

     */
    private HashMap<String, XmlSchema> readInSchema(String localOutputDirectory,
                                                JAXWSCatalogManager catalogManager) throws Exception {
        try {

            XmlSchemaCollection schemaCollection = new XmlSchemaCollection();
            if (catalogManager != null)
                schemaCollection.setSchemaResolver(new CatalogURIResolver(catalogManager));
            schemaCollection.setBaseUri(new File(localOutputDirectory).getAbsolutePath());

            HashMap<String, XmlSchema> docMap = new HashMap<String, XmlSchema>();
            List<File> schemaFiles = getSchemaFiles(localOutputDirectory);
            for (File schemaFile : schemaFiles) {
                XmlSchema doc = schemaCollection.read(new InputSource(schemaFile.toURL().toString()), null);
                if (log.isDebugEnabled()) {
                    log.debug("Read in schema file: " + schemaFile.getName());
                }
                docMap.put(schemaFile.getName(), doc);
            }
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

                } else if (schemaImport.getNamespace().equals(Constants.NS_URI_XML)) {
                    // AXIS2-3229: some Web services (e.g. MS Exchange) assume that
                    // http://www.w3.org/XML/1998/namespace is a known namespace and that
                    // no schemaLocation is required when importing it. Load a local copy of
                    // the schema in that case.
                    schema1 = new XmlSchemaCollection().read(new InputSource(
                            SchemaCompiler.class.getResource("namespace.xsd").toExternalForm()));
                    schemaImport.setSchema(schema1);
                    compile(schema1, isPartofGroup);
                } else if (!schemaImport.getNamespace().equals(Constants.URI_2001_SCHEMA_XSD)) {
                    // Give the user a hint why the schema compilation fails...
View Full Code Here

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

    private Map<String, List<XSDefinition>> map = new HashMap<String, List<XSDefinition>>();
    private XmlSchemaCollection schemaCollection;

    public XSDModelResolver(Contribution contribution, FactoryExtensionPoint modelFactories) {
        this.contribution = contribution;
        this.schemaCollection = new XmlSchemaCollection();
        schemaCollection.setSchemaResolver(new URIResolverImpl(contribution));
        this.factory = new DefaultXSDFactory();
    }
View Full Code Here

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

        QName ELEMENT_QNAME = new QName("http://soapinterop.org/xsd",
                                        "complexElt");


        InputStream is = new FileInputStream(Resources.asURI("mixedContent.xsd"));
        XmlSchemaCollection schema = new XmlSchemaCollection();
        XmlSchema s = schema.read(new StreamSource(is), null);

        XmlSchemaElement elementByName = s.getElementByName(ELEMENT_QNAME);
        assertNotNull(elementByName);

        XmlSchemaType schemaType = elementByName.getSchemaType();
View Full Code Here

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

        QName ELEMENT_QNAME = new QName("http://soapinterop.org/xsd",
                                        "complexElt");


        InputStream is = new FileInputStream(Resources.asURI("block.xsd"));
        XmlSchemaCollection schema = new XmlSchemaCollection();
        XmlSchema s = schema.read(new StreamSource(is), null);

        XmlSchemaElement elementByName = s.getElementByName(ELEMENT_QNAME);
        assertNotNull(elementByName);

        String value = elementByName.getBlock().getValue();
View Full Code Here

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

                "layoutComponentType");
        QName ELEMENT_QNAME = new QName("http://soapinterop.org/types",
                "foo");

        InputStream is = new FileInputStream(Resources.asURI("SimpleContentRestriction.xsd"));
        XmlSchemaCollection schema = new XmlSchemaCollection();
        XmlSchema s = schema.read(new StreamSource(is), null);

        XmlSchemaType simpleType = schema.getTypeByQName(TYPE_QNAME);
        assertNotNull(simpleType);

        XmlSchemaElement elem = schema.getElementByQName(ELEMENT_QNAME);
        assertNotNull(elem);

        XmlSchemaType type = elem.getSchemaType();
        assertNotNull(type);
    }
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.