private void updateSchemaLocation(XmlSchema schema) throws AxisFault { for (XmlSchemaExternal xmlSchemaExternal : schema.getExternals()) { XmlSchema s = xmlSchemaExternal.getSchema(); updateSchemaLocation(s, xmlSchemaExternal); } }
private static void updateSchemaRefs(XmlSchema parentSchema, String name) { for (Iterator iter = parentSchema.getIncludes().getIterator(); iter.hasNext();) { Object obj = iter.next(); if (obj instanceof XmlSchemaExternal) { XmlSchemaExternal extSchema = (XmlSchemaExternal)obj; String location = extSchema.getSchemaLocation(); if (location.length() > 0 && location.indexOf(":/") < 0 && location.indexOf("?xsd=") < 0) { extSchema.setSchemaLocation(name + "?xsd=" + location); } if (extSchema.getSchema() != null) { updateSchemaRefs(extSchema.getSchema(), name); } } } }
private void updateSchemaLocation(XmlSchema s, XmlSchemaExternal xmlSchemaExternal) throws AxisFault { if (s != null) { String schemaLocation = xmlSchemaExternal.getSchemaLocation(); if (schemaLocation.indexOf("://") == -1 && schemaLocation.indexOf("?xsd=") == -1) { String newscheamlocation = this.getServiceEPR() + "?xsd=" + schemaLocation; xmlSchemaExternal.setSchemaLocation(newscheamlocation); } } }
private XmlSchema getSchema(XmlSchema parentSchema, String name) { for (Iterator iter = parentSchema.getIncludes().getIterator(); iter.hasNext();) { Object obj = iter.next(); if (obj instanceof XmlSchemaExternal) { XmlSchemaExternal extSchema = (XmlSchemaExternal)obj; if (extSchema.getSchemaLocation().endsWith(name)) { return extSchema.getSchema(); } else { XmlSchema schema = getSchema(extSchema.getSchema(), name); if (schema != null) { return schema; } } } } return null; }
if (externalComponent instanceof XmlSchemaExternal) { XmlSchemaExternal xmlSchemaExternal = (XmlSchemaExternal)externalComponent; XmlSchema schema1 = xmlSchemaExternal.getSchema(); if (schema1 != null) { String sourceURI = getAbsoluteSchemaURL(schema1.getSourceURI()); SchemaInfo info = schemas.get(sourceURI); String relativeSchemaPath = WSDLUtil.computeRelativePathWithVersion(schemaInfo.getProposedRegistryURL(), info.getProposedRegistryURL(), registry); xmlSchemaExternal.setSchemaLocation(relativeSchemaPath);
private void findImports(XmlSchema schema, Set<XmlSchema> processedImports, Set<XmlSchema> processedIncludes) { processedImports.add(schema); List<XmlSchemaExternal> externals = schema.getExternals(); for (XmlSchemaExternal external : externals) { if (external instanceof XmlSchemaImport) { XmlSchemaImport schemaImport = (XmlSchemaImport) external; XmlSchema importedSchema = schemaImport.getSchema(); if (!"http://www.w3.org/XML/1998/namespace".equals(schemaImport.getNamespace()) && importedSchema != null && !processedImports.contains(importedSchema)) { inlineIncludes(importedSchema, processedIncludes, processedImports); findImports(importedSchema, processedImports, processedIncludes); xmlSchemas.add(importedSchema); } // remove the schemaLocation external.setSchemaLocation(null); } } }
if (externalComponent instanceof XmlSchemaExternal) { XmlSchemaExternal xmlSchemaExternal = (XmlSchemaExternal)externalComponent; XmlSchema schema1 = xmlSchemaExternal.getSchema(); if (schema1 != null) { String sourceURI = getAbsoluteSchemaURL(schema1.getSourceURI()); WSDLUtil.computeRelativePathWithVersion(schemaInfo.getProposedRegistryURL(), info.getProposedRegistryURL(), registry); xmlSchemaExternal.setSchemaLocation(relativeSchemaPath);
private void updateSchemaLocation(XmlSchema s, XmlSchemaExternal xmlSchemaExternal) throws AxisFault { if (s != null) { String schemaLocation = xmlSchemaExternal.getSchemaLocation(); if (schemaLocation.indexOf("://") == -1 && schemaLocation.indexOf("?xsd=") == -1) { String newscheamlocation = this.getServiceEPR() + "?xsd=" + schemaLocation; xmlSchemaExternal.setSchemaLocation(newscheamlocation); } } }
private void findImports(XmlSchema schema, Set<XmlSchema> processedImports, Set<XmlSchema> processedIncludes) { processedImports.add(schema); List<XmlSchemaExternal> externals = schema.getExternals(); for (XmlSchemaExternal external : externals) { if (external instanceof XmlSchemaImport) { XmlSchemaImport schemaImport = (XmlSchemaImport) external; XmlSchema importedSchema = schemaImport.getSchema(); if (!"http://www.w3.org/XML/1998/namespace".equals(schemaImport.getNamespace()) && importedSchema != null && !processedImports.contains(importedSchema)) { inlineIncludes(importedSchema, processedIncludes, processedImports); findImports(importedSchema, processedImports, processedIncludes); xmlSchemas.add(importedSchema); } // remove the schemaLocation external.setSchemaLocation(null); } } }
private void updateSchemaLocation(XmlSchema schema) throws AxisFault { for (XmlSchemaExternal xmlSchemaExternal : schema.getExternals()) { XmlSchema s = xmlSchemaExternal.getSchema(); updateSchemaLocation(s, xmlSchemaExternal); } }
if (externalComponent instanceof XmlSchemaExternal) { XmlSchemaExternal xmlSchemaExternal = (XmlSchemaExternal)externalComponent; String sourceURI = xmlSchemaExternal.getSchema().getSourceURI(); if (!visitedSchemas.contains(sourceURI)) { saveSchemaFileToRegistry(xmlSchemaExternal.getSchema(), processedSchemaMap, null, visitedSchemas, false, registryBasePath, processIncludes, changeSchemaNames.put(xmlSchemaExternal.getSchemaLocation(), newLocation); } else { xmlSchemaExternal.setSchemaLocation(newLocation); String innerFileNameToSave = (String)processedSchemaMap.get(sourceURI); String innerXSDPath = getXSDPath(registryBasePath, innerFileNameToSave);
/** * Adjusts a given schema location * * @param s * @param xmlSchemaExternal * @param nameTable */ private void adjustSchemaLocation(XmlSchema s, XmlSchemaExternal xmlSchemaExternal, Hashtable nameTable, Hashtable importedScheams, Hashtable sourceURIToNewLocationMap) { if (s != null) { String schemaLocation = xmlSchemaExternal.getSchemaLocation(); String newscheamlocation = customSchemaNamePrefix == null ? // use the default mode (this.getServiceEPR() + "?xsd=" + getScheamLocationWithDot( sourceURIToNewLocationMap, s)) : // custom prefix is present - add the custom prefix (customSchemaNamePrefix + getScheamLocationWithDot( sourceURIToNewLocationMap, s)); xmlSchemaExternal.setSchemaLocation(newscheamlocation); importedScheams.put(schemaLocation, newscheamlocation); } }
private void findImports(XmlSchema schema, Set<XmlSchema> processedImports, Set<XmlSchema> processedIncludes) { processedImports.add(schema); XmlSchemaObjectCollection includes = schema.getIncludes(); for (int i = 0; i < includes.getCount(); i++) { XmlSchemaExternal external = (XmlSchemaExternal) includes.getItem(i); if (external instanceof XmlSchemaImport) { XmlSchemaImport schemaImport = (XmlSchemaImport) external; XmlSchema importedSchema = schemaImport.getSchema(); if (!"http://www.w3.org/XML/1998/namespace".equals(schemaImport.getNamespace()) && importedSchema != null && !processedImports.contains(importedSchema)) { inlineIncludes(importedSchema, processedIncludes, processedImports); findImports(importedSchema, processedImports, processedIncludes); xmlSchemas.add(importedSchema); } // remove the schemaLocation external.setSchemaLocation(null); } } }
/** * Adjust a single schema * * @param parentSchema * @param nameTable */ private void adjustSchemaName(XmlSchema parentSchema, Hashtable nameTable, Hashtable importedScheams, Hashtable sourceURIToNewLocationMap) { for (XmlSchemaExternal xmlSchemaExternal : parentSchema.getExternals()) { XmlSchema s = xmlSchemaExternal.getSchema(); adjustSchemaLocation(s, xmlSchemaExternal, nameTable, importedScheams, sourceURIToNewLocationMap); } }
if (externalComponent instanceof XmlSchemaExternal) { XmlSchemaExternal xmlSchemaExternal = (XmlSchemaExternal)externalComponent; String sourceURI = xmlSchemaExternal.getSchema().getSourceURI(); if (!visitedSchemas.contains(sourceURI)) { saveSchemaFileToRegistry(xmlSchemaExternal.getSchema(), processedSchemaMap, null, visitedSchemas, false, registryBasePath, processIncludes, changeSchemaNames.put(xmlSchemaExternal.getSchemaLocation(), newLocation); } else { xmlSchemaExternal.setSchemaLocation(newLocation); String innerFileNameToSave = (String)processedSchemaMap.get(sourceURI); String innerXSDPath = getXSDPath(registryBasePath, innerFileNameToSave);
/** * Adjusts a given schema location * * @param s * @param xmlSchemaExternal * @param nameTable */ private void adjustSchemaLocation(XmlSchema s, XmlSchemaExternal xmlSchemaExternal, Hashtable nameTable, Hashtable importedScheams, Hashtable sourceURIToNewLocationMap) { if (s != null) { String schemaLocation = xmlSchemaExternal.getSchemaLocation(); String newscheamlocation = customSchemaNamePrefix == null ? // use the default mode (this.getServiceEPR() + "?xsd=" + getScheamLocationWithDot( sourceURIToNewLocationMap, s)) : // custom prefix is present - add the custom prefix (customSchemaNamePrefix + getScheamLocationWithDot( sourceURIToNewLocationMap, s)); xmlSchemaExternal.setSchemaLocation(newscheamlocation); importedScheams.put(schemaLocation, newscheamlocation); } }
/** * Adjust a single schema * * @param parentSchema * @param nameTable */ private void adjustSchemaName(XmlSchema parentSchema, Hashtable nameTable, Hashtable importedScheams, Hashtable sourceURIToNewLocationMap) { for (XmlSchemaExternal xmlSchemaExternal : parentSchema.getExternals()) { XmlSchema s = xmlSchemaExternal.getSchema(); adjustSchemaLocation(s, xmlSchemaExternal, nameTable, importedScheams, sourceURIToNewLocationMap); } }
public static boolean isElementFormQualified(XmlSchema schema, QName type) { if (type != null) { String uri = type.getNamespaceURI(); if (uri.equals(schema.getTargetNamespace())) { return schema.getElementFormDefault() == XmlSchemaForm.QUALIFIED; } for (XmlSchemaExternal extSchema : schema.getExternals()) { return isElementFormQualified(extSchema.getSchema(), type); } } return false; }
private static boolean isElementFormQualified(XmlSchema schema, String uri) { if (uri.equals(schema.getTargetNamespace())) { return schema.getElementFormDefault() == XmlSchemaForm.QUALIFIED; } for (XmlSchemaExternal extSchema : schema.getExternals()) { return isElementFormQualified(extSchema.getSchema(), uri); } return false; }
private static boolean isAttributeFormQualified(XmlSchema schema, String uri) { if (uri.equals(schema.getTargetNamespace())) { return schema.getAttributeFormDefault() == XmlSchemaForm.QUALIFIED; } for (XmlSchemaExternal extSchema : schema.getExternals()) { return isAttributeFormQualified(extSchema.getSchema(), uri); } return false; }