Java Code Examples for com.sun.org.apache.xerces.internal.xni.XMLAttributes#getAugmentations()

The following examples show how to use com.sun.org.apache.xerces.internal.xni.XMLAttributes#getAugmentations() . 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: ShortHandPointer.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Returns the schema-determined-ID.
 *
 *
 * @param attributes
 * @param index
 * @return A String containing the schema-determined ID.
 * @throws XNIException
 */
public String getSchemaDeterminedID(XMLAttributes attributes, int index)
throws XNIException {
    Augmentations augs = attributes.getAugmentations(index);
    AttributePSVI attrPSVI = (AttributePSVI) augs
    .getItem(Constants.ATTRIBUTE_PSVI);

    if (attrPSVI != null) {
        // An element or attribute information item is a schema-determined
        // ID if and only if one of the following is true:]

        // 1. It has a [member type definition] or [type definition] property
        // whose value in turn has [name] equal to ID and [target namespace]
        // equal to http://www.w3.org/2001/XMLSchema;

        // 2. It has a [base type definition] whose value has that [name] and [target namespace];

        // 3. It has a [base type definition] whose value has a [base type definition]
        // whose value has that [name] and [target namespace], and so on following
        // the [base type definition] property recursively;

        XSTypeDefinition typeDef = attrPSVI.getMemberTypeDefinition();
        if (typeDef != null) {
            typeDef = attrPSVI.getTypeDefinition();
        }

        //
        if (typeDef != null && ((XSSimpleType) typeDef).isIDType()) {
            return attrPSVI.getSchemaNormalizedValue();
        }

        // 4 & 5 NA
    }

    return null;
}
 
Example 2
Source File: XPointerElementHandler.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
public boolean checkStringToken(QName element, XMLAttributes attributes){
    QName cacheQName = null;
    String id =null;
    String rawname =null;
    QName attrName = new QName();
    String attrType = null;
    String attrValue = null;
    int attrCount = attributes.getLength();
    for (int i = 0; i < attrCount; i++) {
        Augmentations aaugs = attributes.getAugmentations(i);
        attributes.getName(i,attrName);
        attrType = attributes.getType(i);
        attrValue = attributes.getValue(i);
        if(attrType != null && attrValue!= null && isIdAttribute(attributes,aaugs,i) && attrValue.equals(fCurrentTokenString)){
            if(hasMoreToken()){
                fCurrentTokenType = 0;
                fCurrentTokenString = null;
                return true;
            }
            else{
                foundElement = element;
                includeElement = true;
                fCurrentTokenType = 0;
                fCurrentTokenString = null;
                fSubResourceIdentified = true;
                return true;
            }
        }
    }
    return false;
}
 
Example 3
Source File: ShortHandPointer.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Returns the schema-determined-ID.
 *
 *
 * @param attributes
 * @param index
 * @return A String containing the schema-determined ID.
 * @throws XNIException
 */
public String getSchemaDeterminedID(XMLAttributes attributes, int index)
throws XNIException {
    Augmentations augs = attributes.getAugmentations(index);
    AttributePSVI attrPSVI = (AttributePSVI) augs
    .getItem(Constants.ATTRIBUTE_PSVI);

    if (attrPSVI != null) {
        // An element or attribute information item is a schema-determined
        // ID if and only if one of the following is true:]

        // 1. It has a [member type definition] or [type definition] property
        // whose value in turn has [name] equal to ID and [target namespace]
        // equal to http://www.w3.org/2001/XMLSchema;

        // 2. It has a [base type definition] whose value has that [name] and [target namespace];

        // 3. It has a [base type definition] whose value has a [base type definition]
        // whose value has that [name] and [target namespace], and so on following
        // the [base type definition] property recursively;

        XSTypeDefinition typeDef = attrPSVI.getMemberTypeDefinition();
        if (typeDef != null) {
            typeDef = attrPSVI.getTypeDefinition();
        }

        //
        if (typeDef != null && ((XSSimpleType) typeDef).isIDType()) {
            return attrPSVI.getSchemaNormalizedValue();
        }

        // 4 & 5 NA
    }

    return null;
}
 
Example 4
Source File: XPointerElementHandler.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
public boolean checkStringToken(QName element, XMLAttributes attributes){
    QName cacheQName = null;
    String id =null;
    String rawname =null;
    QName attrName = new QName();
    String attrType = null;
    String attrValue = null;
    int attrCount = attributes.getLength();
    for (int i = 0; i < attrCount; i++) {
        Augmentations aaugs = attributes.getAugmentations(i);
        attributes.getName(i,attrName);
        attrType = attributes.getType(i);
        attrValue = attributes.getValue(i);
        if(attrType != null && attrValue!= null && isIdAttribute(attributes,aaugs,i) && attrValue.equals(fCurrentTokenString)){
            if(hasMoreToken()){
                fCurrentTokenType = 0;
                fCurrentTokenString = null;
                return true;
            }
            else{
                foundElement = element;
                includeElement = true;
                fCurrentTokenType = 0;
                fCurrentTokenString = null;
                fSubResourceIdentified = true;
                return true;
            }
        }
    }
    return false;
}
 
Example 5
Source File: ShortHandPointer.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Returns the schema-determined-ID.
 *
 *
 * @param attributes
 * @param index
 * @return A String containing the schema-determined ID.
 * @throws XNIException
 */
public String getSchemaDeterminedID(XMLAttributes attributes, int index)
throws XNIException {
    Augmentations augs = attributes.getAugmentations(index);
    AttributePSVI attrPSVI = (AttributePSVI) augs
    .getItem(Constants.ATTRIBUTE_PSVI);

    if (attrPSVI != null) {
        // An element or attribute information item is a schema-determined
        // ID if and only if one of the following is true:]

        // 1. It has a [member type definition] or [type definition] property
        // whose value in turn has [name] equal to ID and [target namespace]
        // equal to http://www.w3.org/2001/XMLSchema;

        // 2. It has a [base type definition] whose value has that [name] and [target namespace];

        // 3. It has a [base type definition] whose value has a [base type definition]
        // whose value has that [name] and [target namespace], and so on following
        // the [base type definition] property recursively;

        XSTypeDefinition typeDef = attrPSVI.getMemberTypeDefinition();
        if (typeDef != null) {
            typeDef = attrPSVI.getTypeDefinition();
        }

        //
        if (typeDef != null && ((XSSimpleType) typeDef).isIDType()) {
            return attrPSVI.getSchemaNormalizedValue();
        }

        // 4 & 5 NA
    }

    return null;
}
 
Example 6
Source File: XPointerElementHandler.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
public boolean checkStringToken(QName element, XMLAttributes attributes){
    QName cacheQName = null;
    String id =null;
    String rawname =null;
    QName attrName = new QName();
    String attrType = null;
    String attrValue = null;
    int attrCount = attributes.getLength();
    for (int i = 0; i < attrCount; i++) {
        Augmentations aaugs = attributes.getAugmentations(i);
        attributes.getName(i,attrName);
        attrType = attributes.getType(i);
        attrValue = attributes.getValue(i);
        if(attrType != null && attrValue!= null && isIdAttribute(attributes,aaugs,i) && attrValue.equals(fCurrentTokenString)){
            if(hasMoreToken()){
                fCurrentTokenType = 0;
                fCurrentTokenString = null;
                return true;
            }
            else{
                foundElement = element;
                includeElement = true;
                fCurrentTokenType = 0;
                fCurrentTokenString = null;
                fSubResourceIdentified = true;
                return true;
            }
        }
    }
    return false;
}
 
Example 7
Source File: ShortHandPointer.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Returns the schema-determined-ID.
 *
 *
 * @param attributes
 * @param index
 * @return A String containing the schema-determined ID.
 * @throws XNIException
 */
public String getSchemaDeterminedID(XMLAttributes attributes, int index)
throws XNIException {
    Augmentations augs = attributes.getAugmentations(index);
    AttributePSVI attrPSVI = (AttributePSVI) augs
    .getItem(Constants.ATTRIBUTE_PSVI);

    if (attrPSVI != null) {
        // An element or attribute information item is a schema-determined
        // ID if and only if one of the following is true:]

        // 1. It has a [member type definition] or [type definition] property
        // whose value in turn has [name] equal to ID and [target namespace]
        // equal to http://www.w3.org/2001/XMLSchema;

        // 2. It has a [base type definition] whose value has that [name] and [target namespace];

        // 3. It has a [base type definition] whose value has a [base type definition]
        // whose value has that [name] and [target namespace], and so on following
        // the [base type definition] property recursively;

        XSTypeDefinition typeDef = attrPSVI.getMemberTypeDefinition();
        if (typeDef != null) {
            typeDef = attrPSVI.getTypeDefinition();
        }

        //
        if (typeDef != null && ((XSSimpleType) typeDef).isIDType()) {
            return attrPSVI.getSchemaNormalizedValue();
        }

        // 4 & 5 NA
    }

    return null;
}
 
Example 8
Source File: ShortHandPointer.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Returns the schema-determined-ID.
 *
 *
 * @param attributes
 * @param index
 * @return A String containing the schema-determined ID.
 * @throws XNIException
 */
public String getSchemaDeterminedID(XMLAttributes attributes, int index)
throws XNIException {
    Augmentations augs = attributes.getAugmentations(index);
    AttributePSVI attrPSVI = (AttributePSVI) augs
    .getItem(Constants.ATTRIBUTE_PSVI);

    if (attrPSVI != null) {
        // An element or attribute information item is a schema-determined
        // ID if and only if one of the following is true:]

        // 1. It has a [member type definition] or [type definition] property
        // whose value in turn has [name] equal to ID and [target namespace]
        // equal to http://www.w3.org/2001/XMLSchema;

        // 2. It has a [base type definition] whose value has that [name] and [target namespace];

        // 3. It has a [base type definition] whose value has a [base type definition]
        // whose value has that [name] and [target namespace], and so on following
        // the [base type definition] property recursively;

        XSTypeDefinition typeDef = attrPSVI.getMemberTypeDefinition();
        if (typeDef != null) {
            typeDef = attrPSVI.getTypeDefinition();
        }

        //
        if (typeDef != null && ((XSSimpleType) typeDef).isIDType()) {
            return attrPSVI.getSchemaNormalizedValue();
        }

        // 4 & 5 NA
    }

    return null;
}
 
Example 9
Source File: ShortHandPointer.java    From Bytecoder with Apache License 2.0 5 votes vote down vote up
/**
 * Returns the schema-determined-ID.
 *
 *
 * @param attributes
 * @param index
 * @return A String containing the schema-determined ID.
 * @throws XNIException
 */
public String getSchemaDeterminedID(XMLAttributes attributes, int index)
throws XNIException {
    Augmentations augs = attributes.getAugmentations(index);
    AttributePSVI attrPSVI = (AttributePSVI) augs
    .getItem(Constants.ATTRIBUTE_PSVI);

    if (attrPSVI != null) {
        // An element or attribute information item is a schema-determined
        // ID if and only if one of the following is true:]

        // 1. It has a [member type definition] or [type definition] property
        // whose value in turn has [name] equal to ID and [target namespace]
        // equal to http://www.w3.org/2001/XMLSchema;

        // 2. It has a [base type definition] whose value has that [name] and [target namespace];

        // 3. It has a [base type definition] whose value has a [base type definition]
        // whose value has that [name] and [target namespace], and so on following
        // the [base type definition] property recursively;

        XSTypeDefinition typeDef = attrPSVI.getMemberTypeDefinition();
        if (typeDef != null) {
            typeDef = attrPSVI.getTypeDefinition();
        }

        //
        if (typeDef != null && ((XSSimpleType) typeDef).isIDType()) {
            return attrPSVI.getSchemaValue().getNormalizedValue();
        }

        // 4 & 5 NA
    }

    return null;
}
 
Example 10
Source File: XPointerElementHandler.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
public boolean checkStringToken(QName element, XMLAttributes attributes){
    QName cacheQName = null;
    String id =null;
    String rawname =null;
    QName attrName = new QName();
    String attrType = null;
    String attrValue = null;
    int attrCount = attributes.getLength();
    for (int i = 0; i < attrCount; i++) {
        Augmentations aaugs = attributes.getAugmentations(i);
        attributes.getName(i,attrName);
        attrType = attributes.getType(i);
        attrValue = attributes.getValue(i);
        if(attrType != null && attrValue!= null && isIdAttribute(attributes,aaugs,i) && attrValue.equals(fCurrentTokenString)){
            if(hasMoreToken()){
                fCurrentTokenType = 0;
                fCurrentTokenString = null;
                return true;
            }
            else{
                foundElement = element;
                includeElement = true;
                fCurrentTokenType = 0;
                fCurrentTokenString = null;
                fSubResourceIdentified = true;
                return true;
            }
        }
    }
    return false;
}
 
Example 11
Source File: ShortHandPointer.java    From jdk1.8-source-analysis with Apache License 2.0 5 votes vote down vote up
/**
 * Returns the schema-determined-ID.
 *
 *
 * @param attributes
 * @param index
 * @return A String containing the schema-determined ID.
 * @throws XNIException
 */
public String getSchemaDeterminedID(XMLAttributes attributes, int index)
throws XNIException {
    Augmentations augs = attributes.getAugmentations(index);
    AttributePSVI attrPSVI = (AttributePSVI) augs
    .getItem(Constants.ATTRIBUTE_PSVI);

    if (attrPSVI != null) {
        // An element or attribute information item is a schema-determined
        // ID if and only if one of the following is true:]

        // 1. It has a [member type definition] or [type definition] property
        // whose value in turn has [name] equal to ID and [target namespace]
        // equal to http://www.w3.org/2001/XMLSchema;

        // 2. It has a [base type definition] whose value has that [name] and [target namespace];

        // 3. It has a [base type definition] whose value has a [base type definition]
        // whose value has that [name] and [target namespace], and so on following
        // the [base type definition] property recursively;

        XSTypeDefinition typeDef = attrPSVI.getMemberTypeDefinition();
        if (typeDef != null) {
            typeDef = attrPSVI.getTypeDefinition();
        }

        //
        if (typeDef != null && ((XSSimpleType) typeDef).isIDType()) {
            return attrPSVI.getSchemaNormalizedValue();
        }

        // 4 & 5 NA
    }

    return null;
}
 
Example 12
Source File: XPointerElementHandler.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
public boolean checkStringToken(QName element, XMLAttributes attributes){
    QName cacheQName = null;
    String id =null;
    String rawname =null;
    QName attrName = new QName();
    String attrType = null;
    String attrValue = null;
    int attrCount = attributes.getLength();
    for (int i = 0; i < attrCount; i++) {
        Augmentations aaugs = attributes.getAugmentations(i);
        attributes.getName(i,attrName);
        attrType = attributes.getType(i);
        attrValue = attributes.getValue(i);
        if(attrType != null && attrValue!= null && isIdAttribute(attributes,aaugs,i) && attrValue.equals(fCurrentTokenString)){
            if(hasMoreToken()){
                fCurrentTokenType = 0;
                fCurrentTokenString = null;
                return true;
            }
            else{
                foundElement = element;
                includeElement = true;
                fCurrentTokenType = 0;
                fCurrentTokenString = null;
                fSubResourceIdentified = true;
                return true;
            }
        }
    }
    return false;
}
 
Example 13
Source File: ShortHandPointer.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Returns the schema-determined-ID.
 *
 *
 * @param attributes
 * @param index
 * @return A String containing the schema-determined ID.
 * @throws XNIException
 */
public String getSchemaDeterminedID(XMLAttributes attributes, int index)
throws XNIException {
    Augmentations augs = attributes.getAugmentations(index);
    AttributePSVI attrPSVI = (AttributePSVI) augs
    .getItem(Constants.ATTRIBUTE_PSVI);

    if (attrPSVI != null) {
        // An element or attribute information item is a schema-determined
        // ID if and only if one of the following is true:]

        // 1. It has a [member type definition] or [type definition] property
        // whose value in turn has [name] equal to ID and [target namespace]
        // equal to http://www.w3.org/2001/XMLSchema;

        // 2. It has a [base type definition] whose value has that [name] and [target namespace];

        // 3. It has a [base type definition] whose value has a [base type definition]
        // whose value has that [name] and [target namespace], and so on following
        // the [base type definition] property recursively;

        XSTypeDefinition typeDef = attrPSVI.getMemberTypeDefinition();
        if (typeDef != null) {
            typeDef = attrPSVI.getTypeDefinition();
        }

        //
        if (typeDef != null && ((XSSimpleType) typeDef).isIDType()) {
            return attrPSVI.getSchemaNormalizedValue();
        }

        // 4 & 5 NA
    }

    return null;
}
 
Example 14
Source File: XPointerElementHandler.java    From JDKSourceCode1.8 with MIT License 5 votes vote down vote up
public boolean checkStringToken(QName element, XMLAttributes attributes){
    QName cacheQName = null;
    String id =null;
    String rawname =null;
    QName attrName = new QName();
    String attrType = null;
    String attrValue = null;
    int attrCount = attributes.getLength();
    for (int i = 0; i < attrCount; i++) {
        Augmentations aaugs = attributes.getAugmentations(i);
        attributes.getName(i,attrName);
        attrType = attributes.getType(i);
        attrValue = attributes.getValue(i);
        if(attrType != null && attrValue!= null && isIdAttribute(attributes,aaugs,i) && attrValue.equals(fCurrentTokenString)){
            if(hasMoreToken()){
                fCurrentTokenType = 0;
                fCurrentTokenString = null;
                return true;
            }
            else{
                foundElement = element;
                includeElement = true;
                fCurrentTokenType = 0;
                fCurrentTokenString = null;
                fSubResourceIdentified = true;
                return true;
            }
        }
    }
    return false;
}
 
Example 15
Source File: ShortHandPointer.java    From JDKSourceCode1.8 with MIT License 5 votes vote down vote up
/**
 * Returns the schema-determined-ID.
 *
 *
 * @param attributes
 * @param index
 * @return A String containing the schema-determined ID.
 * @throws XNIException
 */
public String getSchemaDeterminedID(XMLAttributes attributes, int index)
throws XNIException {
    Augmentations augs = attributes.getAugmentations(index);
    AttributePSVI attrPSVI = (AttributePSVI) augs
    .getItem(Constants.ATTRIBUTE_PSVI);

    if (attrPSVI != null) {
        // An element or attribute information item is a schema-determined
        // ID if and only if one of the following is true:]

        // 1. It has a [member type definition] or [type definition] property
        // whose value in turn has [name] equal to ID and [target namespace]
        // equal to http://www.w3.org/2001/XMLSchema;

        // 2. It has a [base type definition] whose value has that [name] and [target namespace];

        // 3. It has a [base type definition] whose value has a [base type definition]
        // whose value has that [name] and [target namespace], and so on following
        // the [base type definition] property recursively;

        XSTypeDefinition typeDef = attrPSVI.getMemberTypeDefinition();
        if (typeDef != null) {
            typeDef = attrPSVI.getTypeDefinition();
        }

        //
        if (typeDef != null && ((XSSimpleType) typeDef).isIDType()) {
            return attrPSVI.getSchemaNormalizedValue();
        }

        // 4 & 5 NA
    }

    return null;
}
 
Example 16
Source File: XPointerElementHandler.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
public boolean checkStringToken(QName element, XMLAttributes attributes){
    QName cacheQName = null;
    String id =null;
    String rawname =null;
    QName attrName = new QName();
    String attrType = null;
    String attrValue = null;
    int attrCount = attributes.getLength();
    for (int i = 0; i < attrCount; i++) {
        Augmentations aaugs = attributes.getAugmentations(i);
        attributes.getName(i,attrName);
        attrType = attributes.getType(i);
        attrValue = attributes.getValue(i);
        if(attrType != null && attrValue!= null && isIdAttribute(attributes,aaugs,i) && attrValue.equals(fCurrentTokenString)){
            if(hasMoreToken()){
                fCurrentTokenType = 0;
                fCurrentTokenString = null;
                return true;
            }
            else{
                foundElement = element;
                includeElement = true;
                fCurrentTokenType = 0;
                fCurrentTokenString = null;
                fSubResourceIdentified = true;
                return true;
            }
        }
    }
    return false;
}
 
Example 17
Source File: ShortHandPointer.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Returns the schema-determined-ID.
 *
 *
 * @param attributes
 * @param index
 * @return A String containing the schema-determined ID.
 * @throws XNIException
 */
public String getSchemaDeterminedID(XMLAttributes attributes, int index)
throws XNIException {
    Augmentations augs = attributes.getAugmentations(index);
    AttributePSVI attrPSVI = (AttributePSVI) augs
    .getItem(Constants.ATTRIBUTE_PSVI);

    if (attrPSVI != null) {
        // An element or attribute information item is a schema-determined
        // ID if and only if one of the following is true:]

        // 1. It has a [member type definition] or [type definition] property
        // whose value in turn has [name] equal to ID and [target namespace]
        // equal to http://www.w3.org/2001/XMLSchema;

        // 2. It has a [base type definition] whose value has that [name] and [target namespace];

        // 3. It has a [base type definition] whose value has a [base type definition]
        // whose value has that [name] and [target namespace], and so on following
        // the [base type definition] property recursively;

        XSTypeDefinition typeDef = attrPSVI.getMemberTypeDefinition();
        if (typeDef != null) {
            typeDef = attrPSVI.getTypeDefinition();
        }

        //
        if (typeDef != null && ((XSSimpleType) typeDef).isIDType()) {
            return attrPSVI.getSchemaNormalizedValue();
        }

        // 4 & 5 NA
    }

    return null;
}
 
Example 18
Source File: XPointerElementHandler.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
public boolean checkStringToken(QName element, XMLAttributes attributes){
    QName cacheQName = null;
    String id =null;
    String rawname =null;
    QName attrName = new QName();
    String attrType = null;
    String attrValue = null;
    int attrCount = attributes.getLength();
    for (int i = 0; i < attrCount; i++) {
        Augmentations aaugs = attributes.getAugmentations(i);
        attributes.getName(i,attrName);
        attrType = attributes.getType(i);
        attrValue = attributes.getValue(i);
        if(attrType != null && attrValue!= null && isIdAttribute(attributes,aaugs,i) && attrValue.equals(fCurrentTokenString)){
            if(hasMoreToken()){
                fCurrentTokenType = 0;
                fCurrentTokenString = null;
                return true;
            }
            else{
                foundElement = element;
                includeElement = true;
                fCurrentTokenType = 0;
                fCurrentTokenString = null;
                fSubResourceIdentified = true;
                return true;
            }
        }
    }
    return false;
}
 
Example 19
Source File: ShortHandPointer.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Returns the schema-determined-ID.
 *
 *
 * @param attributes
 * @param index
 * @return A String containing the schema-determined ID.
 * @throws XNIException
 */
public String getSchemaDeterminedID(XMLAttributes attributes, int index)
throws XNIException {
    Augmentations augs = attributes.getAugmentations(index);
    AttributePSVI attrPSVI = (AttributePSVI) augs
    .getItem(Constants.ATTRIBUTE_PSVI);

    if (attrPSVI != null) {
        // An element or attribute information item is a schema-determined
        // ID if and only if one of the following is true:]

        // 1. It has a [member type definition] or [type definition] property
        // whose value in turn has [name] equal to ID and [target namespace]
        // equal to http://www.w3.org/2001/XMLSchema;

        // 2. It has a [base type definition] whose value has that [name] and [target namespace];

        // 3. It has a [base type definition] whose value has a [base type definition]
        // whose value has that [name] and [target namespace], and so on following
        // the [base type definition] property recursively;

        XSTypeDefinition typeDef = attrPSVI.getMemberTypeDefinition();
        if (typeDef != null) {
            typeDef = attrPSVI.getTypeDefinition();
        }

        //
        if (typeDef != null && ((XSSimpleType) typeDef).isIDType()) {
            return attrPSVI.getSchemaNormalizedValue();
        }

        // 4 & 5 NA
    }

    return null;
}
 
Example 20
Source File: XPointerElementHandler.java    From jdk1.8-source-analysis with Apache License 2.0 5 votes vote down vote up
public boolean checkStringToken(QName element, XMLAttributes attributes){
    QName cacheQName = null;
    String id =null;
    String rawname =null;
    QName attrName = new QName();
    String attrType = null;
    String attrValue = null;
    int attrCount = attributes.getLength();
    for (int i = 0; i < attrCount; i++) {
        Augmentations aaugs = attributes.getAugmentations(i);
        attributes.getName(i,attrName);
        attrType = attributes.getType(i);
        attrValue = attributes.getValue(i);
        if(attrType != null && attrValue!= null && isIdAttribute(attributes,aaugs,i) && attrValue.equals(fCurrentTokenString)){
            if(hasMoreToken()){
                fCurrentTokenType = 0;
                fCurrentTokenString = null;
                return true;
            }
            else{
                foundElement = element;
                includeElement = true;
                fCurrentTokenType = 0;
                fCurrentTokenString = null;
                fSubResourceIdentified = true;
                return true;
            }
        }
    }
    return false;
}