Java Code Examples for com.sun.org.apache.xerces.internal.impl.xs.XSDDescription#setTargetNamespace()

The following examples show how to use com.sun.org.apache.xerces.internal.impl.xs.XSDDescription#setTargetNamespace() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: XSDHandler.java    From jdk1.8-source-analysis with Apache License 2.0 5 votes vote down vote up
/**
 * getSchemaDocument method uses XMLInputSource to parse a schema document.
 * @param schemaNamespace
 * @param schemaSource
 * @param mustResolve
 * @param referType
 * @param referElement
 * @return A schema Element.
 */
private Element getSchemaDocument(XSInputSource schemaSource, XSDDescription desc) {

    SchemaGrammar[] grammars = schemaSource.getGrammars();
    short referType = desc.getContextType();

    if (grammars != null && grammars.length > 0) {
        Vector expandedGrammars = expandGrammars(grammars);
        // check for existing grammars in our bucket
        // and if there exist any, and namespace growth is
        // not enabled - we do nothing
        if (fNamespaceGrowth || !existingGrammars(expandedGrammars)) {
            addGrammars(expandedGrammars);
            if (referType == XSDDescription.CONTEXT_PREPARSE) {
                desc.setTargetNamespace(grammars[0].getTargetNamespace());
            }
        }
    }
    else {
        XSObject[] components = schemaSource.getComponents();
        if (components != null && components.length > 0) {
            Map<String, Vector> importDependencies = new HashMap();
            Vector expandedComponents = expandComponents(components, importDependencies);
            if (fNamespaceGrowth || canAddComponents(expandedComponents)) {
                addGlobalComponents(expandedComponents, importDependencies);
                if (referType == XSDDescription.CONTEXT_PREPARSE) {
                    desc.setTargetNamespace(components[0].getNamespace());
                }
            }
        }
    }
    return null;
}
 
Example 2
Source File: XSDHandler.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * getSchemaDocument method uses XMLInputSource to parse a schema document.
 * @param schemaNamespace
 * @param schemaSource
 * @param mustResolve
 * @param referType
 * @param referElement
 * @return A schema Element.
 */
private Element getSchemaDocument(XSInputSource schemaSource, XSDDescription desc) {

    SchemaGrammar[] grammars = schemaSource.getGrammars();
    short referType = desc.getContextType();

    if (grammars != null && grammars.length > 0) {
        Vector expandedGrammars = expandGrammars(grammars);
        // check for existing grammars in our bucket
        // and if there exist any, and namespace growth is
        // not enabled - we do nothing
        if (fNamespaceGrowth || !existingGrammars(expandedGrammars)) {
            addGrammars(expandedGrammars);
            if (referType == XSDDescription.CONTEXT_PREPARSE) {
                desc.setTargetNamespace(grammars[0].getTargetNamespace());
            }
        }
    }
    else {
        XSObject[] components = schemaSource.getComponents();
        if (components != null && components.length > 0) {
            Map<String, Vector> importDependencies = new HashMap();
            Vector expandedComponents = expandComponents(components, importDependencies);
            if (fNamespaceGrowth || canAddComponents(expandedComponents)) {
                addGlobalComponents(expandedComponents, importDependencies);
                if (referType == XSDDescription.CONTEXT_PREPARSE) {
                    desc.setTargetNamespace(components[0].getNamespace());
                }
            }
        }
    }
    return null;
}
 
Example 3
Source File: XSDHandler.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * getSchemaDocument method uses XMLInputSource to parse a schema document.
 * @param schemaNamespace
 * @param schemaSource
 * @param mustResolve
 * @param referType
 * @param referElement
 * @return A schema Element.
 */
private Element getSchemaDocument(XSInputSource schemaSource, XSDDescription desc) {

    SchemaGrammar[] grammars = schemaSource.getGrammars();
    short referType = desc.getContextType();

    if (grammars != null && grammars.length > 0) {
        Vector expandedGrammars = expandGrammars(grammars);
        // check for existing grammars in our bucket
        // and if there exist any, and namespace growth is
        // not enabled - we do nothing
        if (fNamespaceGrowth || !existingGrammars(expandedGrammars)) {
            addGrammars(expandedGrammars);
            if (referType == XSDDescription.CONTEXT_PREPARSE) {
                desc.setTargetNamespace(grammars[0].getTargetNamespace());
            }
        }
    }
    else {
        XSObject[] components = schemaSource.getComponents();
        if (components != null && components.length > 0) {
            Map<String, Vector> importDependencies = new HashMap();
            Vector expandedComponents = expandComponents(components, importDependencies);
            if (fNamespaceGrowth || canAddComponents(expandedComponents)) {
                addGlobalComponents(expandedComponents, importDependencies);
                if (referType == XSDDescription.CONTEXT_PREPARSE) {
                    desc.setTargetNamespace(components[0].getNamespace());
                }
            }
        }
    }
    return null;
}
 
Example 4
Source File: XSDHandler.java    From JDKSourceCode1.8 with MIT License 5 votes vote down vote up
/**
 * getSchemaDocument method uses XMLInputSource to parse a schema document.
 * @param schemaNamespace
 * @param schemaSource
 * @param mustResolve
 * @param referType
 * @param referElement
 * @return A schema Element.
 */
private Element getSchemaDocument(XSInputSource schemaSource, XSDDescription desc) {

    SchemaGrammar[] grammars = schemaSource.getGrammars();
    short referType = desc.getContextType();

    if (grammars != null && grammars.length > 0) {
        Vector expandedGrammars = expandGrammars(grammars);
        // check for existing grammars in our bucket
        // and if there exist any, and namespace growth is
        // not enabled - we do nothing
        if (fNamespaceGrowth || !existingGrammars(expandedGrammars)) {
            addGrammars(expandedGrammars);
            if (referType == XSDDescription.CONTEXT_PREPARSE) {
                desc.setTargetNamespace(grammars[0].getTargetNamespace());
            }
        }
    }
    else {
        XSObject[] components = schemaSource.getComponents();
        if (components != null && components.length > 0) {
            Map<String, Vector> importDependencies = new HashMap();
            Vector expandedComponents = expandComponents(components, importDependencies);
            if (fNamespaceGrowth || canAddComponents(expandedComponents)) {
                addGlobalComponents(expandedComponents, importDependencies);
                if (referType == XSDDescription.CONTEXT_PREPARSE) {
                    desc.setTargetNamespace(components[0].getNamespace());
                }
            }
        }
    }
    return null;
}
 
Example 5
Source File: XSDHandler.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
/**
 * getSchemaDocument method uses XMLInputSource to parse a schema document.
 * @param schemaNamespace
 * @param schemaSource
 * @param mustResolve
 * @param referType
 * @param referElement
 * @return A schema Element.
 */
private Element getSchemaDocument(XSInputSource schemaSource, XSDDescription desc) {

    SchemaGrammar[] grammars = schemaSource.getGrammars();
    short referType = desc.getContextType();

    if (grammars != null && grammars.length > 0) {
        Vector expandedGrammars = expandGrammars(grammars);
        // check for existing grammars in our bucket
        // and if there exist any, and namespace growth is
        // not enabled - we do nothing
        if (fNamespaceGrowth || !existingGrammars(expandedGrammars)) {
            addGrammars(expandedGrammars);
            if (referType == XSDDescription.CONTEXT_PREPARSE) {
                desc.setTargetNamespace(grammars[0].getTargetNamespace());
            }
        }
    }
    else {
        XSObject[] components = schemaSource.getComponents();
        if (components != null && components.length > 0) {
            Map<String, Vector> importDependencies = new HashMap();
            Vector expandedComponents = expandComponents(components, importDependencies);
            if (fNamespaceGrowth || canAddComponents(expandedComponents)) {
                addGlobalComponents(expandedComponents, importDependencies);
                if (referType == XSDDescription.CONTEXT_PREPARSE) {
                    desc.setTargetNamespace(components[0].getNamespace());
                }
            }
        }
    }
    return null;
}
 
Example 6
Source File: XSDHandler.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
/**
 * getSchemaDocument method uses XMLInputSource to parse a schema document.
 * @param schemaNamespace
 * @param schemaSource
 * @param mustResolve
 * @param referType
 * @param referElement
 * @return A schema Element.
 */
private Element getSchemaDocument(XSInputSource schemaSource, XSDDescription desc) {

    SchemaGrammar[] grammars = schemaSource.getGrammars();
    short referType = desc.getContextType();

    if (grammars != null && grammars.length > 0) {
        Vector expandedGrammars = expandGrammars(grammars);
        // check for existing grammars in our bucket
        // and if there exist any, and namespace growth is
        // not enabled - we do nothing
        if (fNamespaceGrowth || !existingGrammars(expandedGrammars)) {
            addGrammars(expandedGrammars);
            if (referType == XSDDescription.CONTEXT_PREPARSE) {
                desc.setTargetNamespace(grammars[0].getTargetNamespace());
            }
        }
    }
    else {
        XSObject[] components = schemaSource.getComponents();
        if (components != null && components.length > 0) {
            Map<String, Vector> importDependencies = new HashMap();
            Vector expandedComponents = expandComponents(components, importDependencies);
            if (fNamespaceGrowth || canAddComponents(expandedComponents)) {
                addGlobalComponents(expandedComponents, importDependencies);
                if (referType == XSDDescription.CONTEXT_PREPARSE) {
                    desc.setTargetNamespace(components[0].getNamespace());
                }
            }
        }
    }
    return null;
}
 
Example 7
Source File: XSDHandler.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * getSchemaDocument method uses XMLInputSource to parse a schema document.
 * @param schemaNamespace
 * @param schemaSource
 * @param mustResolve
 * @param referType
 * @param referElement
 * @return A schema Element.
 */
private Element getSchemaDocument(XSInputSource schemaSource, XSDDescription desc) {

    SchemaGrammar[] grammars = schemaSource.getGrammars();
    short referType = desc.getContextType();

    if (grammars != null && grammars.length > 0) {
        Vector expandedGrammars = expandGrammars(grammars);
        // check for existing grammars in our bucket
        // and if there exist any, and namespace growth is
        // not enabled - we do nothing
        if (fNamespaceGrowth || !existingGrammars(expandedGrammars)) {
            addGrammars(expandedGrammars);
            if (referType == XSDDescription.CONTEXT_PREPARSE) {
                desc.setTargetNamespace(grammars[0].getTargetNamespace());
            }
        }
    }
    else {
        XSObject[] components = schemaSource.getComponents();
        if (components != null && components.length > 0) {
            Map<String, Vector> importDependencies = new HashMap();
            Vector expandedComponents = expandComponents(components, importDependencies);
            if (fNamespaceGrowth || canAddComponents(expandedComponents)) {
                addGlobalComponents(expandedComponents, importDependencies);
                if (referType == XSDDescription.CONTEXT_PREPARSE) {
                    desc.setTargetNamespace(components[0].getNamespace());
                }
            }
        }
    }
    return null;
}
 
Example 8
Source File: XSDHandler.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
/**
 * getSchemaDocument method uses XMLInputSource to parse a schema document.
 * @param schemaNamespace
 * @param schemaSource
 * @param mustResolve
 * @param referType
 * @param referElement
 * @return A schema Element.
 */
private Element getSchemaDocument(XSInputSource schemaSource, XSDDescription desc) {

    SchemaGrammar[] grammars = schemaSource.getGrammars();
    short referType = desc.getContextType();

    if (grammars != null && grammars.length > 0) {
        Vector expandedGrammars = expandGrammars(grammars);
        // check for existing grammars in our bucket
        // and if there exist any, and namespace growth is
        // not enabled - we do nothing
        if (fNamespaceGrowth || !existingGrammars(expandedGrammars)) {
            addGrammars(expandedGrammars);
            if (referType == XSDDescription.CONTEXT_PREPARSE) {
                desc.setTargetNamespace(grammars[0].getTargetNamespace());
            }
        }
    }
    else {
        XSObject[] components = schemaSource.getComponents();
        if (components != null && components.length > 0) {
            Map<String, Vector> importDependencies = new HashMap();
            Vector expandedComponents = expandComponents(components, importDependencies);
            if (fNamespaceGrowth || canAddComponents(expandedComponents)) {
                addGlobalComponents(expandedComponents, importDependencies);
                if (referType == XSDDescription.CONTEXT_PREPARSE) {
                    desc.setTargetNamespace(components[0].getNamespace());
                }
            }
        }
    }
    return null;
}
 
Example 9
Source File: XSDHandler.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
/**
 * getSchemaDocument method uses XMLInputSource to parse a schema document.
 * @param schemaNamespace
 * @param schemaSource
 * @param mustResolve
 * @param referType
 * @param referElement
 * @return A schema Element.
 */
private Element getSchemaDocument(XSInputSource schemaSource, XSDDescription desc) {

    SchemaGrammar[] grammars = schemaSource.getGrammars();
    short referType = desc.getContextType();

    if (grammars != null && grammars.length > 0) {
        Vector expandedGrammars = expandGrammars(grammars);
        // check for existing grammars in our bucket
        // and if there exist any, and namespace growth is
        // not enabled - we do nothing
        if (fNamespaceGrowth || !existingGrammars(expandedGrammars)) {
            addGrammars(expandedGrammars);
            if (referType == XSDDescription.CONTEXT_PREPARSE) {
                desc.setTargetNamespace(grammars[0].getTargetNamespace());
            }
        }
    }
    else {
        XSObject[] components = schemaSource.getComponents();
        if (components != null && components.length > 0) {
            Map<String, Vector> importDependencies = new HashMap();
            Vector expandedComponents = expandComponents(components, importDependencies);
            if (fNamespaceGrowth || canAddComponents(expandedComponents)) {
                addGlobalComponents(expandedComponents, importDependencies);
                if (referType == XSDDescription.CONTEXT_PREPARSE) {
                    desc.setTargetNamespace(components[0].getNamespace());
                }
            }
        }
    }
    return null;
}
 
Example 10
Source File: XSDHandler.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * getSchemaDocument method uses XMLInputSource to parse a schema document.
 * @param schemaNamespace
 * @param schemaSource
 * @param mustResolve
 * @param referType
 * @param referElement
 * @return A schema Element.
 */
private Element getSchemaDocument(XSInputSource schemaSource, XSDDescription desc) {

    SchemaGrammar[] grammars = schemaSource.getGrammars();
    short referType = desc.getContextType();

    if (grammars != null && grammars.length > 0) {
        Vector expandedGrammars = expandGrammars(grammars);
        // check for existing grammars in our bucket
        // and if there exist any, and namespace growth is
        // not enabled - we do nothing
        if (fNamespaceGrowth || !existingGrammars(expandedGrammars)) {
            addGrammars(expandedGrammars);
            if (referType == XSDDescription.CONTEXT_PREPARSE) {
                desc.setTargetNamespace(grammars[0].getTargetNamespace());
            }
        }
    }
    else {
        XSObject[] components = schemaSource.getComponents();
        if (components != null && components.length > 0) {
            Map<String, Vector> importDependencies = new HashMap();
            Vector expandedComponents = expandComponents(components, importDependencies);
            if (fNamespaceGrowth || canAddComponents(expandedComponents)) {
                addGlobalComponents(expandedComponents, importDependencies);
                if (referType == XSDDescription.CONTEXT_PREPARSE) {
                    desc.setTargetNamespace(components[0].getNamespace());
                }
            }
        }
    }
    return null;
}