Package org.apache.ws.commons.schema

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


        if (types != null) {
            List extensibleElements = types.getExtensibilityElements();
            Schema schemaExtension;     
            Object extensionObject;
            XmlSchema xmlSchema;
            XmlSchemaCollection xmlSchemaCollection;
            wsdlDocumentBaseURI = wsdlDocumentBaseURI.substring(0, wsdlDocumentBaseURI.lastIndexOf("/") + 1);
            for (Object extensibleElement : extensibleElements) {
                extensionObject = extensibleElement;
                if (extensionObject instanceof Schema) {
                    schemaExtension = (Schema)extensionObject;
                    xmlSchemaCollection = new XmlSchemaCollection();
                    /* setting base URI in the collection to load relative schemas */
                    xmlSchemaCollection.setBaseUri(wsdlDocumentBaseURI);
                    xmlSchema = xmlSchemaCollection.read(schemaExtension.getElement());
                    evaluateSchemasRecursively(xmlSchema, dependencies, true, false);
                }
            }
        }
    }
View Full Code Here


        public WSDL11ToAxisPatchedBuilder(InputStream in) {
            super(in);
        }

        protected XmlSchema getXMLSchema(Element element, String baseUri) {
            XmlSchemaCollection schemaCollection = new XmlSchemaCollection();
            if (baseUri != null) {
                schemaCollection.setBaseUri(baseUri);
            }
            return schemaCollection.read(element, baseUri);
        }
View Full Code Here

        public WSDL11ToAxisPatchedBuilder(InputStream in) {
            super(in);
        }

        protected XmlSchema getXMLSchema(Element element, String baseUri) {
            XmlSchemaCollection schemaCollection = new XmlSchemaCollection();
            if (baseUri != null) {
                schemaCollection.setBaseUri(baseUri);
            }
            return schemaCollection.read(element, baseUri);
        }
View Full Code Here

                        }
                        return s;
                    }
                }
               
                XmlSchemaCollection schemaCollection = new XmlSchemaCollection();
                if (baseUri != null) {
                    schemaCollection.setBaseUri(baseUri);
                }
                XmlSchema schema = schemaCollection.read(element, baseUri);
                cached.put(digest, new WeakReference<XmlSchema>(schema));
                return schema;
            }
        }
View Full Code Here

        if (types != null) {
            List extensibleElements = types.getExtensibilityElements();
            Schema schemaExtension;
            Object extensionObject;
            XmlSchema xmlSchema;
            XmlSchemaCollection xmlSchemaCollection;
            SchemaFileProcessor schemaFileProcessor;
            Map changedLocationMap;
            String basuri = wsdlDefinition.getDocumentBaseURI();
            basuri = basuri.substring(0, basuri.lastIndexOf("/") + 1);
            for (Object extensibleElement : extensibleElements) {
                extensionObject = extensibleElement;
                if (extensionObject instanceof Schema) {
                    // first get the schema object
                    schemaExtension = (Schema)extensionObject;
                    // create an xml schema object to be processed by SchemaFile procesor.
                    xmlSchemaCollection = new XmlSchemaCollection();
                    xmlSchemaCollection.setBaseUri(basuri);
                    xmlSchema = xmlSchemaCollection.read(schemaExtension.getElement());
                    schemaFileProcessor = new SchemaFileProcessor(registry);
                    changedLocationMap = new HashMap();
                    HashSet visitedSchemas = new HashSet();
                    schemaFileProcessor.calculateNewSchemaNames(
                            xmlSchema, processedScheamMap, visitedSchemas, true, processImports);
View Full Code Here

                                           String registryBasePath,
                                           boolean processIncludes,
                                           Resource metadata)
            throws RegistryException {

        XmlSchemaCollection xmlSchemaCollection = new XmlSchemaCollection();
        InputSource inputSource = new InputSource(location);

        // Here we assue schema is correct. Schema validation is beyond our scope, so we don't
        // bother with a ValidationEventHandler.
        XmlSchema xmlSchema = xmlSchemaCollection.read(inputSource, null);

        String baseUri = xmlSchema.getSourceURI();
        String xsdFileName = baseUri.substring(baseUri.lastIndexOf("/") + 1);
        String savedName = xsdFileName.substring(0, xsdFileName.indexOf(".")) + ".xsd";
View Full Code Here

     */
    public SchemaGenerator(String schemaTargetNamespace) {
        this.schemaTargetNamespace = schemaTargetNamespace;

        // Initialize XmlSchema and XmlSchemaCollection
        XmlSchemaCollection xmlSchemaCollection = new XmlSchemaCollection();
        xmlSchema = new XmlSchema(this.schemaTargetNamespace, xmlSchemaCollection);

        // Setting attributeFormDefault and elementFormDefault to unqualified
        xmlSchema.setAttributeFormDefault(new XmlSchemaForm(XmlSchemaForm.UNQUALIFIED));
        xmlSchema.setElementFormDefault(new XmlSchemaForm(XmlSchemaForm.UNQUALIFIED));
View Full Code Here

   
    private Map<String, QName> requestInputElementMap = new HashMap<String, QName>();
   
    public CommonParams(AxisService axisService, DataService dataservice) {
      this.schemaMap = new HashMap<String, XmlSchema>();
      this.xmlSchemaCollection = new XmlSchemaCollection();
      this.elementMap = new HashMap<QName, XmlSchemaElement>();
      this.typeMap = new HashMap<QName, XmlSchemaComplexType>();
      this.axisService = axisService;
      this.dataservice = dataservice;
    }
View Full Code Here

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


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

    }
View Full Code Here

    /**
     * @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();
            }
            XmlSchema schema = xsd.getSchema();
            XmlSchemaElement element = getXmlSchemaObject(schema, name, XmlSchemaElement.class);
            if (element != null) {
                return element;
            }
        }
        if (schemaCollection != null) {
            return schemaCollection.getElementByQName(name);
        }
        return null;
    }
View Full Code Here

TOP

Related Classes of org.apache.ws.commons.schema.XmlSchemaCollection

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.