Java Code Examples for com.sun.org.apache.xerces.internal.xni.NamespaceContext#XML_URI

The following examples show how to use com.sun.org.apache.xerces.internal.xni.NamespaceContext#XML_URI . 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: MultipleScopeNamespaceSupport.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
public String getPrefix(String uri, int start, int end) {
    // this saves us from having a copy of each of these in fNamespace for each scope
    if (uri == NamespaceContext.XML_URI) {
        return XMLSymbols.PREFIX_XML;
    }
    if (uri == NamespaceContext.XMLNS_URI) {
        return XMLSymbols.PREFIX_XMLNS;
    }

    // find uri in current context
    for (int i = start; i > end; i -= 2) {
        if (fNamespace[i - 1] == uri) {
            if (getURI(fNamespace[i - 2]) == uri)
                return fNamespace[i - 2];
        }
    }

    // uri not found
    return null;
}
 
Example 2
Source File: NamespaceSupport.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
/**
 * @see com.sun.org.apache.xerces.internal.xni.NamespaceContext#reset()
 */
public void reset() {

    // reset namespace and context info
    fNamespaceSize = 0;
    fCurrentContext = 0;


    // bind "xml" prefix to the XML uri
    fNamespace[fNamespaceSize++] = XMLSymbols.PREFIX_XML;
    fNamespace[fNamespaceSize++] = NamespaceContext.XML_URI;
    // bind "xmlns" prefix to the XMLNS uri
    fNamespace[fNamespaceSize++] = XMLSymbols.PREFIX_XMLNS;
    fNamespace[fNamespaceSize++] = NamespaceContext.XMLNS_URI;

    fContext[fCurrentContext] = fNamespaceSize;
    //++fCurrentContext;

}
 
Example 3
Source File: MultipleScopeNamespaceSupport.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
public String getPrefix(String uri, int start, int end) {
    // this saves us from having a copy of each of these in fNamespace for each scope
    if (uri == NamespaceContext.XML_URI) {
        return XMLSymbols.PREFIX_XML;
    }
    if (uri == NamespaceContext.XMLNS_URI) {
        return XMLSymbols.PREFIX_XMLNS;
    }

    // find uri in current context
    for (int i = start; i > end; i -= 2) {
        if (fNamespace[i - 1] == uri) {
            if (getURI(fNamespace[i - 2]) == uri)
                return fNamespace[i - 2];
        }
    }

    // uri not found
    return null;
}
 
Example 4
Source File: MultipleScopeNamespaceSupport.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
public String getPrefix(String uri, int start, int end) {
    // this saves us from having a copy of each of these in fNamespace for each scope
    if (uri == NamespaceContext.XML_URI) {
        return XMLSymbols.PREFIX_XML;
    }
    if (uri == NamespaceContext.XMLNS_URI) {
        return XMLSymbols.PREFIX_XMLNS;
    }

    // find uri in current context
    for (int i = start; i > end; i -= 2) {
        if (fNamespace[i - 1] == uri) {
            if (getURI(fNamespace[i - 2]) == uri)
                return fNamespace[i - 2];
        }
    }

    // uri not found
    return null;
}
 
Example 5
Source File: NamespaceSupport.java    From Bytecoder with Apache License 2.0 6 votes vote down vote up
/**
 * @see com.sun.org.apache.xerces.internal.xni.NamespaceContext#reset()
 */
public void reset() {

    // reset namespace and context info
    fNamespaceSize = 0;
    fCurrentContext = 0;


    // bind "xml" prefix to the XML uri
    fNamespace[fNamespaceSize++] = XMLSymbols.PREFIX_XML;
    fNamespace[fNamespaceSize++] = NamespaceContext.XML_URI;
    // bind "xmlns" prefix to the XMLNS uri
    fNamespace[fNamespaceSize++] = XMLSymbols.PREFIX_XMLNS;
    fNamespace[fNamespaceSize++] = NamespaceContext.XMLNS_URI;

    fContext[fCurrentContext] = fNamespaceSize;
    //++fCurrentContext;

}
 
Example 6
Source File: MultipleScopeNamespaceSupport.java    From JDKSourceCode1.8 with MIT License 6 votes vote down vote up
public String getURI(String prefix, int start, int end) {
    // this saves us from having a copy of each of these in fNamespace for each scope
    if (prefix == XMLSymbols.PREFIX_XML) {
        return NamespaceContext.XML_URI;
    }
    if (prefix == XMLSymbols.PREFIX_XMLNS) {
        return NamespaceContext.XMLNS_URI;
    }

    // find prefix in current context
    for (int i = start; i > end; i -= 2) {
        if (fNamespace[i - 2] == prefix) {
            return fNamespace[i - 1];
        }
    }

    // prefix not found
    return null;
}
 
Example 7
Source File: MultipleScopeNamespaceSupport.java    From JDKSourceCode1.8 with MIT License 6 votes vote down vote up
public String getPrefix(String uri, int start, int end) {
    // this saves us from having a copy of each of these in fNamespace for each scope
    if (uri == NamespaceContext.XML_URI) {
        return XMLSymbols.PREFIX_XML;
    }
    if (uri == NamespaceContext.XMLNS_URI) {
        return XMLSymbols.PREFIX_XMLNS;
    }

    // find uri in current context
    for (int i = start; i > end; i -= 2) {
        if (fNamespace[i - 1] == uri) {
            if (getURI(fNamespace[i - 2]) == uri)
                return fNamespace[i - 2];
        }
    }

    // uri not found
    return null;
}
 
Example 8
Source File: NamespaceSupport.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
/**
 * @see com.sun.org.apache.xerces.internal.xni.NamespaceContext#reset()
 */
public void reset() {

    // reset namespace and context info
    fNamespaceSize = 0;
    fCurrentContext = 0;


    // bind "xml" prefix to the XML uri
    fNamespace[fNamespaceSize++] = XMLSymbols.PREFIX_XML;
    fNamespace[fNamespaceSize++] = NamespaceContext.XML_URI;
    // bind "xmlns" prefix to the XMLNS uri
    fNamespace[fNamespaceSize++] = XMLSymbols.PREFIX_XMLNS;
    fNamespace[fNamespaceSize++] = NamespaceContext.XMLNS_URI;

    fContext[fCurrentContext] = fNamespaceSize;
    //++fCurrentContext;

}
 
Example 9
Source File: MultipleScopeNamespaceSupport.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
public String getURI(String prefix, int start, int end) {
    // this saves us from having a copy of each of these in fNamespace for each scope
    if (prefix == XMLSymbols.PREFIX_XML) {
        return NamespaceContext.XML_URI;
    }
    if (prefix == XMLSymbols.PREFIX_XMLNS) {
        return NamespaceContext.XMLNS_URI;
    }

    // find prefix in current context
    for (int i = start; i > end; i -= 2) {
        if (fNamespace[i - 2] == prefix) {
            return fNamespace[i - 1];
        }
    }

    // prefix not found
    return null;
}
 
Example 10
Source File: NamespaceSupport.java    From jdk1.8-source-analysis with Apache License 2.0 6 votes vote down vote up
/**
 * @see com.sun.org.apache.xerces.internal.xni.NamespaceContext#reset()
 */
public void reset() {

    // reset namespace and context info
    fNamespaceSize = 0;
    fCurrentContext = 0;


    // bind "xml" prefix to the XML uri
    fNamespace[fNamespaceSize++] = XMLSymbols.PREFIX_XML;
    fNamespace[fNamespaceSize++] = NamespaceContext.XML_URI;
    // bind "xmlns" prefix to the XMLNS uri
    fNamespace[fNamespaceSize++] = XMLSymbols.PREFIX_XMLNS;
    fNamespace[fNamespaceSize++] = NamespaceContext.XMLNS_URI;

    fContext[fCurrentContext] = fNamespaceSize;
    //++fCurrentContext;

}
 
Example 11
Source File: MultipleScopeNamespaceSupport.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
public String getURI(String prefix, int start, int end) {
    // this saves us from having a copy of each of these in fNamespace for each scope
    if (prefix == XMLSymbols.PREFIX_XML) {
        return NamespaceContext.XML_URI;
    }
    if (prefix == XMLSymbols.PREFIX_XMLNS) {
        return NamespaceContext.XMLNS_URI;
    }

    // find prefix in current context
    for (int i = start; i > end; i -= 2) {
        if (fNamespace[i - 2] == prefix) {
            return fNamespace[i - 1];
        }
    }

    // prefix not found
    return null;
}
 
Example 12
Source File: MultipleScopeNamespaceSupport.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
public String getPrefix(String uri, int start, int end) {
    // this saves us from having a copy of each of these in fNamespace for each scope
    if (uri == NamespaceContext.XML_URI) {
        return XMLSymbols.PREFIX_XML;
    }
    if (uri == NamespaceContext.XMLNS_URI) {
        return XMLSymbols.PREFIX_XMLNS;
    }

    // find uri in current context
    for (int i = start; i > end; i -= 2) {
        if (fNamespace[i - 1] == uri) {
            if (getURI(fNamespace[i - 2]) == uri)
                return fNamespace[i - 2];
        }
    }

    // uri not found
    return null;
}
 
Example 13
Source File: MultipleScopeNamespaceSupport.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
public String getPrefix(String uri, int start, int end) {
    // this saves us from having a copy of each of these in fNamespace for each scope
    if (uri == NamespaceContext.XML_URI) {
        return XMLSymbols.PREFIX_XML;
    }
    if (uri == NamespaceContext.XMLNS_URI) {
        return XMLSymbols.PREFIX_XMLNS;
    }

    // find uri in current context
    for (int i = start; i > end; i -= 2) {
        if (fNamespace[i - 1] == uri) {
            if (getURI(fNamespace[i - 2]) == uri)
                return fNamespace[i - 2];
        }
    }

    // uri not found
    return null;
}
 
Example 14
Source File: NamespaceSupport.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * @see com.sun.org.apache.xerces.internal.xni.NamespaceContext#reset()
 */
public void reset() {

    // reset namespace and context info
    fNamespaceSize = 0;
    fCurrentContext = 0;


    // bind "xml" prefix to the XML uri
    fNamespace[fNamespaceSize++] = XMLSymbols.PREFIX_XML;
    fNamespace[fNamespaceSize++] = NamespaceContext.XML_URI;
    // bind "xmlns" prefix to the XMLNS uri
    fNamespace[fNamespaceSize++] = XMLSymbols.PREFIX_XMLNS;
    fNamespace[fNamespaceSize++] = NamespaceContext.XMLNS_URI;

    fContext[fCurrentContext] = fNamespaceSize;
    //++fCurrentContext;

}
 
Example 15
Source File: MultipleScopeNamespaceSupport.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
public String getURI(String prefix, int start, int end) {
    // this saves us from having a copy of each of these in fNamespace for each scope
    if (prefix == XMLSymbols.PREFIX_XML) {
        return NamespaceContext.XML_URI;
    }
    if (prefix == XMLSymbols.PREFIX_XMLNS) {
        return NamespaceContext.XMLNS_URI;
    }

    // find prefix in current context
    for (int i = start; i > end; i -= 2) {
        if (fNamespace[i - 2] == prefix) {
            return fNamespace[i - 1];
        }
    }

    // prefix not found
    return null;
}
 
Example 16
Source File: MultipleScopeNamespaceSupport.java    From Bytecoder with Apache License 2.0 6 votes vote down vote up
public String getPrefix(String uri, int start, int end) {
    // this saves us from having a copy of each of these in fNamespace for each scope
    if (uri == NamespaceContext.XML_URI) {
        return XMLSymbols.PREFIX_XML;
    }
    if (uri == NamespaceContext.XMLNS_URI) {
        return XMLSymbols.PREFIX_XMLNS;
    }

    // find uri in current context
    for (int i = start; i > end; i -= 2) {
        if (fNamespace[i - 1] == uri) {
            if (getURI(fNamespace[i - 2]) == uri)
                return fNamespace[i - 2];
        }
    }

    // uri not found
    return null;
}
 
Example 17
Source File: MultipleScopeNamespaceSupport.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
public String getPrefix(String uri, int start, int end) {
    // this saves us from having a copy of each of these in fNamespace for each scope
    if (uri == NamespaceContext.XML_URI) {
        return XMLSymbols.PREFIX_XML;
    }
    if (uri == NamespaceContext.XMLNS_URI) {
        return XMLSymbols.PREFIX_XMLNS;
    }

    // find uri in current context
    for (int i = start; i > end; i -= 2) {
        if (fNamespace[i - 1] == uri) {
            if (getURI(fNamespace[i - 2]) == uri)
                return fNamespace[i - 2];
        }
    }

    // uri not found
    return null;
}
 
Example 18
Source File: SchemaDOMParser.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * @param attributes
 * @return
 */
private boolean hasNonSchemaAttributes(QName element, XMLAttributes attributes) {
    final int length = attributes.getLength();
    for (int i = 0; i < length; ++i) {
        String uri = attributes.getURI(i);
        if (uri != null && uri != SchemaSymbols.URI_SCHEMAFORSCHEMA &&
                uri != NamespaceContext.XMLNS_URI &&
                !(uri == NamespaceContext.XML_URI &&
                        attributes.getQName(i) == SchemaSymbols.ATT_XML_LANG && element.localpart == SchemaSymbols.ELT_SCHEMA)) {
            return true;
        }
    }
    return false;
}
 
Example 19
Source File: SchemaDOMParser.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * @param attributes
 * @return
 */
private boolean hasNonSchemaAttributes(QName element, XMLAttributes attributes) {
    final int length = attributes.getLength();
    for (int i = 0; i < length; ++i) {
        String uri = attributes.getURI(i);
        if (uri != null && uri != SchemaSymbols.URI_SCHEMAFORSCHEMA &&
                uri != NamespaceContext.XMLNS_URI &&
                !(uri == NamespaceContext.XML_URI &&
                        attributes.getQName(i) == SchemaSymbols.ATT_XML_LANG && element.localpart == SchemaSymbols.ELT_SCHEMA)) {
            return true;
        }
    }
    return false;
}
 
Example 20
Source File: SchemaDOMParser.java    From JDKSourceCode1.8 with MIT License 5 votes vote down vote up
/**
 * @param attributes
 * @return
 */
private boolean hasNonSchemaAttributes(QName element, XMLAttributes attributes) {
    final int length = attributes.getLength();
    for (int i = 0; i < length; ++i) {
        String uri = attributes.getURI(i);
        if (uri != null && uri != SchemaSymbols.URI_SCHEMAFORSCHEMA &&
                uri != NamespaceContext.XMLNS_URI &&
                !(uri == NamespaceContext.XML_URI &&
                        attributes.getQName(i) == SchemaSymbols.ATT_XML_LANG && element.localpart == SchemaSymbols.ELT_SCHEMA)) {
            return true;
        }
    }
    return false;
}