com.sun.org.apache.xerces.internal.xs.ElementPSVI Java Examples

The following examples show how to use com.sun.org.apache.xerces.internal.xs.ElementPSVI. 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: PSVIElementNSImpl.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Copy PSVI properties from another psvi item.
 *
 * @param elem  the source of element PSVI items
 */
public void setPSVI(ElementPSVI elem) {
    this.fDeclaration = elem.getElementDeclaration();
    this.fNotation = elem.getNotation();
    this.fValidationContext = elem.getValidationContext();
    this.fTypeDecl = elem.getTypeDefinition();
    this.fSchemaInformation = elem.getSchemaInformation();
    this.fValidity = elem.getValidity();
    this.fValidationAttempted = elem.getValidationAttempted();
    this.fErrorCodes = elem.getErrorCodes();
    this.fErrorMessages = elem.getErrorMessages();
    if (fTypeDecl instanceof XSSimpleTypeDefinition ||
            fTypeDecl instanceof XSComplexTypeDefinition &&
            ((XSComplexTypeDefinition)fTypeDecl).getContentType() == XSComplexTypeDefinition.CONTENTTYPE_SIMPLE) {
        this.fValue.copyFrom(elem.getSchemaValue());
    }
    else {
        this.fValue.reset();
    }
    this.fSpecified = elem.getIsSchemaSpecified();
    this.fNil = elem.getNil();
}
 
Example #2
Source File: ElementPSVImpl.java    From jdk1.8-source-analysis with Apache License 2.0 6 votes vote down vote up
/**
 * Reset() should be called in validator startElement(..) method.
 */
public void reset() {
    fDeclaration = null;
    fTypeDecl = null;
    fNil = false;
    fSpecified = false;
    fNotation = null;
    fMemberType = null;
    fValidationAttempted = ElementPSVI.VALIDATION_NONE;
    fValidity = ElementPSVI.VALIDITY_NOTKNOWN;
    fErrorCodes = null;
    fValidationContext = null;
    fNormalizedValue = null;
    fActualValue = null;
    fActualValueType = XSConstants.UNAVAILABLE_DT;
    fItemValueTypes = null;
}
 
Example #3
Source File: PSVIElementNSImpl.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Copy PSVI properties from another psvi item.
 *
 * @param attr  the source of attribute PSVI items
 */
public void setPSVI(ElementPSVI elem) {
    this.fDeclaration = elem.getElementDeclaration();
    this.fNotation = elem.getNotation();
    this.fValidationContext = elem.getValidationContext();
    this.fTypeDecl = elem.getTypeDefinition();
    this.fSchemaInformation = elem.getSchemaInformation();
    this.fValidity = elem.getValidity();
    this.fValidationAttempted = elem.getValidationAttempted();
    this.fErrorCodes = elem.getErrorCodes();
    this.fNormalizedValue = elem.getSchemaNormalizedValue();
    this.fActualValue = elem.getActualNormalizedValue();
    this.fActualValueType = elem.getActualNormalizedValueType();
    this.fItemValueTypes = elem.getItemValueTypes();
    this.fMemberType = elem.getMemberTypeDefinition();
    this.fSpecified = elem.getIsSchemaSpecified();
    this.fNil = elem.getNil();
}
 
Example #4
Source File: PSVIElementNSImpl.java    From jdk1.8-source-analysis with Apache License 2.0 6 votes vote down vote up
/**
 * Copy PSVI properties from another psvi item.
 *
 * @param attr  the source of attribute PSVI items
 */
public void setPSVI(ElementPSVI elem) {
    this.fDeclaration = elem.getElementDeclaration();
    this.fNotation = elem.getNotation();
    this.fValidationContext = elem.getValidationContext();
    this.fTypeDecl = elem.getTypeDefinition();
    this.fSchemaInformation = elem.getSchemaInformation();
    this.fValidity = elem.getValidity();
    this.fValidationAttempted = elem.getValidationAttempted();
    this.fErrorCodes = elem.getErrorCodes();
    this.fNormalizedValue = elem.getSchemaNormalizedValue();
    this.fActualValue = elem.getActualNormalizedValue();
    this.fActualValueType = elem.getActualNormalizedValueType();
    this.fItemValueTypes = elem.getItemValueTypes();
    this.fMemberType = elem.getMemberTypeDefinition();
    this.fSpecified = elem.getIsSchemaSpecified();
    this.fNil = elem.getNil();
}
 
Example #5
Source File: DOMResultAugmentor.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
public void endElement(QName element, Augmentations augs)
        throws XNIException {
    final Node currentElement = fDOMValidatorHelper.getCurrentElement();
    // Write type information to this element
    if (augs != null && fDocumentImpl != null) {
        ElementPSVI elementPSVI = (ElementPSVI)augs.getItem(Constants.ELEMENT_PSVI);
        if (elementPSVI != null) {
            if (fStorePSVI) {
                ((PSVIElementNSImpl) currentElement).setPSVI(elementPSVI);
            }
            XSTypeDefinition type = elementPSVI.getMemberTypeDefinition();
            if (type == null) {
                type = elementPSVI.getTypeDefinition();
            }
            ((ElementNSImpl) currentElement).setType(type);
        }
    }
}
 
Example #6
Source File: DOMResultBuilder.java    From jdk1.8-source-analysis with Apache License 2.0 6 votes vote down vote up
public void endElement(QName element, Augmentations augs)
        throws XNIException {
    // write type information to this element
    if (augs != null && fDocumentImpl != null) {
        ElementPSVI elementPSVI = (ElementPSVI)augs.getItem(Constants.ELEMENT_PSVI);
        if (elementPSVI != null) {
            if (fStorePSVI) {
                ((PSVIElementNSImpl)fCurrentNode).setPSVI(elementPSVI);
            }
            XSTypeDefinition type = elementPSVI.getMemberTypeDefinition();
            if (type == null) {
                type = elementPSVI.getTypeDefinition();
            }
            ((ElementNSImpl)fCurrentNode).setType(type);
        }
    }

    // adjust current node reference
    if (fCurrentNode == fFragmentRoot) {
        fCurrentNode = null;
        fFragmentRoot = null;
        return;
    }
    fCurrentNode = fCurrentNode.getParentNode();
}
 
Example #7
Source File: DOMResultBuilder.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
public void endElement(QName element, Augmentations augs)
        throws XNIException {
    // write type information to this element
    if (augs != null && fDocumentImpl != null) {
        ElementPSVI elementPSVI = (ElementPSVI)augs.getItem(Constants.ELEMENT_PSVI);
        if (elementPSVI != null) {
            if (fStorePSVI) {
                ((PSVIElementNSImpl)fCurrentNode).setPSVI(elementPSVI);
            }
            XSTypeDefinition type = elementPSVI.getMemberTypeDefinition();
            if (type == null) {
                type = elementPSVI.getTypeDefinition();
            }
            ((ElementNSImpl)fCurrentNode).setType(type);
        }
    }

    // adjust current node reference
    if (fCurrentNode == fFragmentRoot) {
        fCurrentNode = null;
        fFragmentRoot = null;
        return;
    }
    fCurrentNode = fCurrentNode.getParentNode();
}
 
Example #8
Source File: DOMResultAugmentor.java    From jdk1.8-source-analysis with Apache License 2.0 6 votes vote down vote up
public void endElement(QName element, Augmentations augs)
        throws XNIException {
    final Node currentElement = fDOMValidatorHelper.getCurrentElement();
    // Write type information to this element
    if (augs != null && fDocumentImpl != null) {
        ElementPSVI elementPSVI = (ElementPSVI)augs.getItem(Constants.ELEMENT_PSVI);
        if (elementPSVI != null) {
            if (fStorePSVI) {
                ((PSVIElementNSImpl) currentElement).setPSVI(elementPSVI);
            }
            XSTypeDefinition type = elementPSVI.getMemberTypeDefinition();
            if (type == null) {
                type = elementPSVI.getTypeDefinition();
            }
            ((ElementNSImpl) currentElement).setType(type);
        }
    }
}
 
Example #9
Source File: DOMResultBuilder.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
public void endElement(QName element, Augmentations augs)
        throws XNIException {
    // write type information to this element
    if (augs != null && fDocumentImpl != null) {
        ElementPSVI elementPSVI = (ElementPSVI)augs.getItem(Constants.ELEMENT_PSVI);
        if (elementPSVI != null) {
            if (fStorePSVI) {
                ((PSVIElementNSImpl)fCurrentNode).setPSVI(elementPSVI);
            }
            XSTypeDefinition type = elementPSVI.getMemberTypeDefinition();
            if (type == null) {
                type = elementPSVI.getTypeDefinition();
            }
            ((ElementNSImpl)fCurrentNode).setType(type);
        }
    }

    // adjust current node reference
    if (fCurrentNode == fFragmentRoot) {
        fCurrentNode = null;
        fFragmentRoot = null;
        return;
    }
    fCurrentNode = fCurrentNode.getParentNode();
}
 
Example #10
Source File: DOMResultBuilder.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
public void endElement(QName element, Augmentations augs)
        throws XNIException {
    // write type information to this element
    if (augs != null && fDocumentImpl != null) {
        ElementPSVI elementPSVI = (ElementPSVI)augs.getItem(Constants.ELEMENT_PSVI);
        if (elementPSVI != null) {
            if (fStorePSVI) {
                ((PSVIElementNSImpl)fCurrentNode).setPSVI(elementPSVI);
            }
            XSTypeDefinition type = elementPSVI.getMemberTypeDefinition();
            if (type == null) {
                type = elementPSVI.getTypeDefinition();
            }
            ((ElementNSImpl)fCurrentNode).setType(type);
        }
    }

    // adjust current node reference
    if (fCurrentNode == fFragmentRoot) {
        fCurrentNode = null;
        fFragmentRoot = null;
        return;
    }
    fCurrentNode = fCurrentNode.getParentNode();
}
 
Example #11
Source File: ElementPSVImpl.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Reset() should be called in validator startElement(..) method.
 */
public void reset() {
    fDeclaration = null;
    fTypeDecl = null;
    fNil = false;
    fSpecified = false;
    fNotation = null;
    fMemberType = null;
    fValidationAttempted = ElementPSVI.VALIDATION_NONE;
    fValidity = ElementPSVI.VALIDITY_NOTKNOWN;
    fErrorCodes = null;
    fValidationContext = null;
    fNormalizedValue = null;
    fActualValue = null;
    fActualValueType = XSConstants.UNAVAILABLE_DT;
    fItemValueTypes = null;
}
 
Example #12
Source File: DOMResultBuilder.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
public void endElement(QName element, Augmentations augs)
        throws XNIException {
    // write type information to this element
    if (augs != null && fDocumentImpl != null) {
        ElementPSVI elementPSVI = (ElementPSVI)augs.getItem(Constants.ELEMENT_PSVI);
        if (elementPSVI != null) {
            if (fStorePSVI) {
                ((PSVIElementNSImpl)fCurrentNode).setPSVI(elementPSVI);
            }
            XSTypeDefinition type = elementPSVI.getMemberTypeDefinition();
            if (type == null) {
                type = elementPSVI.getTypeDefinition();
            }
            ((ElementNSImpl)fCurrentNode).setType(type);
        }
    }

    // adjust current node reference
    if (fCurrentNode == fFragmentRoot) {
        fCurrentNode = null;
        fFragmentRoot = null;
        return;
    }
    fCurrentNode = fCurrentNode.getParentNode();
}
 
Example #13
Source File: ElementPSVImpl.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Reset() should be called in validator startElement(..) method.
 */
public void reset() {
    fDeclaration = null;
    fTypeDecl = null;
    fNil = false;
    fSpecified = false;
    fNotation = null;
    fMemberType = null;
    fValidationAttempted = ElementPSVI.VALIDATION_NONE;
    fValidity = ElementPSVI.VALIDITY_NOTKNOWN;
    fErrorCodes = null;
    fValidationContext = null;
    fNormalizedValue = null;
    fActualValue = null;
    fActualValueType = XSConstants.UNAVAILABLE_DT;
    fItemValueTypes = null;
}
 
Example #14
Source File: PSVIElementNSImpl.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Copy PSVI properties from another psvi item.
 *
 * @param attr  the source of attribute PSVI items
 */
public void setPSVI(ElementPSVI elem) {
    this.fDeclaration = elem.getElementDeclaration();
    this.fNotation = elem.getNotation();
    this.fValidationContext = elem.getValidationContext();
    this.fTypeDecl = elem.getTypeDefinition();
    this.fSchemaInformation = elem.getSchemaInformation();
    this.fValidity = elem.getValidity();
    this.fValidationAttempted = elem.getValidationAttempted();
    this.fErrorCodes = elem.getErrorCodes();
    this.fNormalizedValue = elem.getSchemaNormalizedValue();
    this.fActualValue = elem.getActualNormalizedValue();
    this.fActualValueType = elem.getActualNormalizedValueType();
    this.fItemValueTypes = elem.getItemValueTypes();
    this.fMemberType = elem.getMemberTypeDefinition();
    this.fSpecified = elem.getIsSchemaSpecified();
    this.fNil = elem.getNil();
}
 
Example #15
Source File: DOMResultAugmentor.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
public void endElement(QName element, Augmentations augs)
        throws XNIException {
    final Node currentElement = fDOMValidatorHelper.getCurrentElement();
    // Write type information to this element
    if (augs != null && fDocumentImpl != null) {
        ElementPSVI elementPSVI = (ElementPSVI)augs.getItem(Constants.ELEMENT_PSVI);
        if (elementPSVI != null) {
            if (fStorePSVI) {
                ((PSVIElementNSImpl) currentElement).setPSVI(elementPSVI);
            }
            XSTypeDefinition type = elementPSVI.getMemberTypeDefinition();
            if (type == null) {
                type = elementPSVI.getTypeDefinition();
            }
            ((ElementNSImpl) currentElement).setType(type);
        }
    }
}
 
Example #16
Source File: PSVIElementNSImpl.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Copy PSVI properties from another psvi item.
 *
 * @param attr  the source of attribute PSVI items
 */
public void setPSVI(ElementPSVI elem) {
    this.fDeclaration = elem.getElementDeclaration();
    this.fNotation = elem.getNotation();
    this.fValidationContext = elem.getValidationContext();
    this.fTypeDecl = elem.getTypeDefinition();
    this.fSchemaInformation = elem.getSchemaInformation();
    this.fValidity = elem.getValidity();
    this.fValidationAttempted = elem.getValidationAttempted();
    this.fErrorCodes = elem.getErrorCodes();
    this.fNormalizedValue = elem.getSchemaNormalizedValue();
    this.fActualValue = elem.getActualNormalizedValue();
    this.fActualValueType = elem.getActualNormalizedValueType();
    this.fItemValueTypes = elem.getItemValueTypes();
    this.fMemberType = elem.getMemberTypeDefinition();
    this.fSpecified = elem.getIsSchemaSpecified();
    this.fNil = elem.getNil();
}
 
Example #17
Source File: DOMResultAugmentor.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
public void endElement(QName element, Augmentations augs)
        throws XNIException {
    final Node currentElement = fDOMValidatorHelper.getCurrentElement();
    // Write type information to this element
    if (augs != null && fDocumentImpl != null) {
        ElementPSVI elementPSVI = (ElementPSVI)augs.getItem(Constants.ELEMENT_PSVI);
        if (elementPSVI != null) {
            if (fStorePSVI) {
                ((PSVIElementNSImpl) currentElement).setPSVI(elementPSVI);
            }
            XSTypeDefinition type = elementPSVI.getMemberTypeDefinition();
            if (type == null) {
                type = elementPSVI.getTypeDefinition();
            }
            ((ElementNSImpl) currentElement).setType(type);
        }
    }
}
 
Example #18
Source File: PSVIElementNSImpl.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Copy PSVI properties from another psvi item.
 *
 * @param attr  the source of attribute PSVI items
 */
public void setPSVI(ElementPSVI elem) {
    this.fDeclaration = elem.getElementDeclaration();
    this.fNotation = elem.getNotation();
    this.fValidationContext = elem.getValidationContext();
    this.fTypeDecl = elem.getTypeDefinition();
    this.fSchemaInformation = elem.getSchemaInformation();
    this.fValidity = elem.getValidity();
    this.fValidationAttempted = elem.getValidationAttempted();
    this.fErrorCodes = elem.getErrorCodes();
    this.fNormalizedValue = elem.getSchemaNormalizedValue();
    this.fActualValue = elem.getActualNormalizedValue();
    this.fActualValueType = elem.getActualNormalizedValueType();
    this.fItemValueTypes = elem.getItemValueTypes();
    this.fMemberType = elem.getMemberTypeDefinition();
    this.fSpecified = elem.getIsSchemaSpecified();
    this.fNil = elem.getNil();
}
 
Example #19
Source File: ElementPSVImpl.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Reset() should be called in validator startElement(..) method.
 */
public void reset() {
    fDeclaration = null;
    fTypeDecl = null;
    fNil = false;
    fSpecified = false;
    fNotation = null;
    fMemberType = null;
    fValidationAttempted = ElementPSVI.VALIDATION_NONE;
    fValidity = ElementPSVI.VALIDITY_NOTKNOWN;
    fErrorCodes = null;
    fValidationContext = null;
    fNormalizedValue = null;
    fActualValue = null;
    fActualValueType = XSConstants.UNAVAILABLE_DT;
    fItemValueTypes = null;
}
 
Example #20
Source File: ElementPSVImpl.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Reset() should be called in validator startElement(..) method.
 */
public void reset() {
    fDeclaration = null;
    fTypeDecl = null;
    fNil = false;
    fSpecified = false;
    fNotation = null;
    fMemberType = null;
    fValidationAttempted = ElementPSVI.VALIDATION_NONE;
    fValidity = ElementPSVI.VALIDITY_NOTKNOWN;
    fErrorCodes = null;
    fValidationContext = null;
    fNormalizedValue = null;
    fActualValue = null;
    fActualValueType = XSConstants.UNAVAILABLE_DT;
    fItemValueTypes = null;
}
 
Example #21
Source File: PSVIElementNSImpl.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Copy PSVI properties from another psvi item.
 *
 * @param attr  the source of attribute PSVI items
 */
public void setPSVI(ElementPSVI elem) {
    this.fDeclaration = elem.getElementDeclaration();
    this.fNotation = elem.getNotation();
    this.fValidationContext = elem.getValidationContext();
    this.fTypeDecl = elem.getTypeDefinition();
    this.fSchemaInformation = elem.getSchemaInformation();
    this.fValidity = elem.getValidity();
    this.fValidationAttempted = elem.getValidationAttempted();
    this.fErrorCodes = elem.getErrorCodes();
    this.fNormalizedValue = elem.getSchemaNormalizedValue();
    this.fActualValue = elem.getActualNormalizedValue();
    this.fActualValueType = elem.getActualNormalizedValueType();
    this.fItemValueTypes = elem.getItemValueTypes();
    this.fMemberType = elem.getMemberTypeDefinition();
    this.fSpecified = elem.getIsSchemaSpecified();
    this.fNil = elem.getNil();
}
 
Example #22
Source File: DOMResultAugmentor.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
public void endElement(QName element, Augmentations augs)
        throws XNIException {
    final Node currentElement = fDOMValidatorHelper.getCurrentElement();
    // Write type information to this element
    if (augs != null && fDocumentImpl != null) {
        ElementPSVI elementPSVI = (ElementPSVI)augs.getItem(Constants.ELEMENT_PSVI);
        if (elementPSVI != null) {
            if (fStorePSVI) {
                ((PSVIElementNSImpl) currentElement).setPSVI(elementPSVI);
            }
            XSTypeDefinition type = elementPSVI.getMemberTypeDefinition();
            if (type == null) {
                type = elementPSVI.getTypeDefinition();
            }
            ((ElementNSImpl) currentElement).setType(type);
        }
    }
}
 
Example #23
Source File: DOMResultBuilder.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
public void endElement(QName element, Augmentations augs)
        throws XNIException {
    // write type information to this element
    if (augs != null && fDocumentImpl != null) {
        ElementPSVI elementPSVI = (ElementPSVI)augs.getItem(Constants.ELEMENT_PSVI);
        if (elementPSVI != null) {
            if (fStorePSVI) {
                ((PSVIElementNSImpl)fCurrentNode).setPSVI(elementPSVI);
            }
            XSTypeDefinition type = elementPSVI.getMemberTypeDefinition();
            if (type == null) {
                type = elementPSVI.getTypeDefinition();
            }
            ((ElementNSImpl)fCurrentNode).setType(type);
        }
    }

    // adjust current node reference
    if (fCurrentNode == fFragmentRoot) {
        fCurrentNode = null;
        fFragmentRoot = null;
        return;
    }
    fCurrentNode = fCurrentNode.getParentNode();
}
 
Example #24
Source File: ElementPSVImpl.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Reset() should be called in validator startElement(..) method.
 */
public void reset() {
    fDeclaration = null;
    fTypeDecl = null;
    fNil = false;
    fSpecified = false;
    fNotation = null;
    fMemberType = null;
    fValidationAttempted = ElementPSVI.VALIDATION_NONE;
    fValidity = ElementPSVI.VALIDITY_NOTKNOWN;
    fErrorCodes = null;
    fValidationContext = null;
    fNormalizedValue = null;
    fActualValue = null;
    fActualValueType = XSConstants.UNAVAILABLE_DT;
    fItemValueTypes = null;
}
 
Example #25
Source File: PSVIElementNSImpl.java    From Bytecoder with Apache License 2.0 6 votes vote down vote up
/**
 * Copy PSVI properties from another psvi item.
 *
 * @param elem  the source of element PSVI items
 */
public void setPSVI(ElementPSVI elem) {
    this.fDeclaration = elem.getElementDeclaration();
    this.fNotation = elem.getNotation();
    this.fValidationContext = elem.getValidationContext();
    this.fTypeDecl = elem.getTypeDefinition();
    this.fSchemaInformation = elem.getSchemaInformation();
    this.fValidity = elem.getValidity();
    this.fValidationAttempted = elem.getValidationAttempted();
    this.fErrorCodes = elem.getErrorCodes();
    this.fErrorMessages = elem.getErrorMessages();
    if (fTypeDecl instanceof XSSimpleTypeDefinition ||
            fTypeDecl instanceof XSComplexTypeDefinition &&
            ((XSComplexTypeDefinition)fTypeDecl).getContentType() == XSComplexTypeDefinition.CONTENTTYPE_SIMPLE) {
        this.fValue.copyFrom(elem.getSchemaValue());
    }
    else {
        this.fValue.reset();
    }
    this.fSpecified = elem.getIsSchemaSpecified();
    this.fNil = elem.getNil();
}
 
Example #26
Source File: DOMResultBuilder.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
public void endElement(QName element, Augmentations augs)
        throws XNIException {
    // write type information to this element
    if (augs != null && fDocumentImpl != null) {
        ElementPSVI elementPSVI = (ElementPSVI)augs.getItem(Constants.ELEMENT_PSVI);
        if (elementPSVI != null) {
            if (fStorePSVI) {
                ((PSVIElementNSImpl)fCurrentNode).setPSVI(elementPSVI);
            }
            XSTypeDefinition type = elementPSVI.getMemberTypeDefinition();
            if (type == null) {
                type = elementPSVI.getTypeDefinition();
            }
            ((ElementNSImpl)fCurrentNode).setType(type);
        }
    }

    // adjust current node reference
    if (fCurrentNode == fFragmentRoot) {
        fCurrentNode = null;
        fFragmentRoot = null;
        return;
    }
    fCurrentNode = fCurrentNode.getParentNode();
}
 
Example #27
Source File: DOMResultBuilder.java    From Bytecoder with Apache License 2.0 6 votes vote down vote up
public void endElement(QName element, Augmentations augs)
        throws XNIException {
    // write type information to this element
    if (augs != null && fDocumentImpl != null) {
        ElementPSVI elementPSVI = (ElementPSVI)augs.getItem(Constants.ELEMENT_PSVI);
        if (elementPSVI != null) {
            if (fStorePSVI) {
                ((PSVIElementNSImpl)fCurrentNode).setPSVI(elementPSVI);
            }
            XSTypeDefinition type = elementPSVI.getMemberTypeDefinition();
            if (type == null) {
                type = elementPSVI.getTypeDefinition();
            }
            ((ElementNSImpl)fCurrentNode).setType(type);
        }
    }

    // adjust current node reference
    if (fCurrentNode == fFragmentRoot) {
        fCurrentNode = null;
        fFragmentRoot = null;
        return;
    }
    fCurrentNode = fCurrentNode.getParentNode();
}
 
Example #28
Source File: RootTypeDefinitionTest.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * XERCESJ-1141 root-type-definition property not read by XMLSchemaValidator during reset()
 */
@Test
public void testUsingDocumentBuilderFactory() throws Exception {
    DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
    dbf.setAttribute(ROOT_TYPE, typeX);
    dbf.setAttribute(DOCUMENT_CLASS_NAME,"com.sun.org.apache.xerces.internal.dom.PSVIDocumentImpl");
    dbf.setNamespaceAware(true);
    dbf.setValidating(false);

    SchemaFactory sf = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
    dbf.setSchema(sf.newSchema(fSchemaURL));

    DocumentBuilder db = dbf.newDocumentBuilder();
    Document document = db.parse(fDocumentURL.toExternalForm());
    ElementPSVI rootNode = (ElementPSVI) document.getDocumentElement();

    assertValidity(ItemPSVI.VALIDITY_VALID, rootNode.getValidity());
    assertValidationAttempted(ItemPSVI.VALIDATION_FULL, rootNode
            .getValidationAttempted());
    assertElementNull(rootNode.getElementDeclaration());
    assertTypeName("X", rootNode.getTypeDefinition().getName());
}
 
Example #29
Source File: DOMNormalizer.java    From jdk1.8-source-analysis with Apache License 2.0 5 votes vote down vote up
/**
* The end of an element.
*
* @param element The name of the element.
* @param augs    Additional information that may include infoset augmentations
*
* @exception XNIException
*                   Thrown by handler to signal an error.
*/
   public void endElement(QName element, Augmentations augs) throws XNIException {
           if (DEBUG_EVENTS) {
                   System.out.println("==>endElement: " + element);
           }

   if(augs != null) {
           ElementPSVI elementPSVI = (ElementPSVI) augs.getItem(Constants.ELEMENT_PSVI);
           if (elementPSVI != null) {
                   ElementImpl elementNode = (ElementImpl) fCurrentNode;
                   if (fPSVI) {
                           ((PSVIElementNSImpl) fCurrentNode).setPSVI(elementPSVI);
                   }
                   // include element default content (if one is available)
                   String normalizedValue = elementPSVI.getSchemaNormalizedValue();
                   if ((fConfiguration.features & DOMConfigurationImpl.DTNORMALIZATION) != 0) {
               if (normalizedValue !=null)
                               elementNode.setTextContent(normalizedValue);
                   }
                   else {
                           // NOTE: this is a hack: it is possible that DOM had an empty element
                           // and validator sent default value using characters(), which we don't
                           // implement. Thus, here we attempt to add the default value.
                           String text = elementNode.getTextContent();
                           if (text.length() == 0) {
                                   // default content could be provided
                   if (normalizedValue !=null)
                       elementNode.setTextContent(normalizedValue);
                           }
                   }
           }
   }
   }
 
Example #30
Source File: BaseTest.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
protected void reset() throws Exception {
//        fDocument = builder.parse(new File("./jaxp-ri/src/unit-test/apache/xerces/jdk8037819/" + getXMLDocument()));
        fDocument = builder.parse(fDocumentURL.toExternalForm());
        fRootNode = (ElementPSVI) fDocument.getDocumentElement();
        fValidator = schema.newValidator();
        fErrorHandler.reset();
        fValidator.setErrorHandler(fErrorHandler);
        fValidator.setFeature(DYNAMIC_VALIDATION, false);
    }