Package org.apache.xerces.impl.xs.psvi

Examples of org.apache.xerces.impl.xs.psvi.XSAttributeDeclaration


                    attrImpl.setSpecified(specified);
                    // Identifier registration
                    // REVISIT: try to retrieve XML Schema attribute declaration
                    //          we should try to modify psvi API to allows to
                    //          check if id type
                    XSAttributeDeclaration xsDecl = (XSAttributeDeclaration)((attrPSVI!=null)?attrPSVI.getAttributeDeclaration():null);
                    if (attributes.getType(i).equals("ID") ||
                        (xsDecl !=null && ((XSSimpleType)xsDecl.getTypeDefinition()).isIDType())) {
                        ((ElementImpl) el).setIdAttributeNode(attr);
                    }
                }
                // REVISIT: Handle entities in attribute value.
            }

            setCharacterData(false);
            fCurrentNode.appendChild(el);
            fCurrentNode = el;
        }
        else {
            int el =
                fDeferredDocumentImpl.createDeferredElement(fNamespaceAware ?
                                                            element.uri : null,
                                                            element.rawname);
            int attrCount = attributes.getLength();
            for (int i = 0; i < attrCount; i++) {
                String attrValue = attributes.getValue(i);
                // REVISIT: consider moving this code to the XML Schema validator.
                //          When PSVI and XML Schema component interfaces are finalized
                //          remove dependancy on *Impl class.
                AttributePSVI attrPSVI = (AttributePSVI)attributes.getAugmentations(i).getItem(Constants.ATTRIBUTE_PSVI);
               
                if (fNormalizeData) {
                    // If validation is not attempted, the SchemaNormalizedValue will be null.
                    // We shouldn't take the normalized value in this case.
                    if (attrPSVI != null && attrPSVI.getValidationAttempted() == AttributePSVI.VALIDATION_FULL) {
                        attrValue = attrPSVI.getSchemaNormalizedValue();
                    }

                }
                int attr = fDeferredDocumentImpl.setDeferredAttribute(el,
                                                    attributes.getQName(i),
                                                    attributes.getURI(i),
                                                    attrValue,
                                                    attributes.isSpecified(i));
                // identifier registration
                // REVISIT: try to retrieve XML Schema attribute declaration
                //          we should try to modify psvi API to allows to
                //          check if id type
                XSAttributeDeclaration xsDecl = (XSAttributeDeclaration)((attrPSVI!=null)?attrPSVI.getAttributeDeclaration():null);
               
                if (attributes.getType(i).equals("ID") ||
                    (xsDecl !=null && ((XSSimpleType)xsDecl.getTypeDefinition()).isIDType())) {
                    fDeferredDocumentImpl.setIdAttributeNode(el, attr);
                }
            }
            fDeferredDocumentImpl.appendChild(fCurrentNodeIndex, el);
            fCurrentNodeIndex = el;
View Full Code Here


                    attrImpl.setSpecified(specified);
                    // Identifier registration
                    // REVISIT: try to retrieve XML Schema attribute declaration
                    //          we should try to modify psvi API to allows to
                    //          check if id type
                    XSAttributeDeclaration xsDecl = (XSAttributeDeclaration)((attrPSVI!=null)?attrPSVI.getAttributeDeclaration():null);
                    if (attributes.getType(i).equals("ID") ||
                        (xsDecl !=null && ((XSSimpleType)xsDecl.getTypeDefinition()).isIDType())) {
                        ((ElementImpl) el).setIdAttributeNode(attr);
                    }
                }
                // REVISIT: Handle entities in attribute value.
            }

            setCharacterData(false);
            // filter nodes
            if (fDOMFilter != null) {
                short code = fDOMFilter.startElement(el);
                switch (code) {
                    case DOMBuilderFilter.FILTER_INTERRUPT:{
                        throw new RuntimeException("The normal processing of the document was interrupted.");
                    }  
                    case DOMBuilderFilter.FILTER_REJECT:{
                        fFilterReject = true;
                        fRejectedElement.setValues(element);
                        return;
                    }
                    case DOMBuilderFilter.FILTER_SKIP: {
                        fSkippedElemStack.push(element);
                        return;
                    }
                    default: {
                    }
                }
            }

            fCurrentNode.appendChild(el);
            fCurrentNode = el;
        }
        else {
            int el =
                fDeferredDocumentImpl.createDeferredElement(fNamespaceAware ?
                                                            element.uri : null,
                                                            element.rawname);
            int attrCount = attributes.getLength();
            for (int i = 0; i < attrCount; i++) {
                String attrValue = attributes.getValue(i);
                // REVISIT: consider moving this code to the XML Schema validator.
                //          When PSVI and XML Schema component interfaces are finalized
                //          remove dependancy on *Impl class.
                AttributePSVI attrPSVI = (AttributePSVI)attributes.getAugmentations(i).getItem(Constants.ATTRIBUTE_PSVI);
               
                if (fNormalizeData) {
                    // If validation is not attempted, the SchemaNormalizedValue will be null.
                    // We shouldn't take the normalized value in this case.
                    if (attrPSVI != null && attrPSVI.getValidationAttempted() == AttributePSVI.VALIDATION_FULL) {
                        attrValue = attrPSVI.getSchemaNormalizedValue();
                    }

                }
                int attr = fDeferredDocumentImpl.setDeferredAttribute(el,
                                                    attributes.getQName(i),
                                                    attributes.getURI(i),
                                                    attrValue,
                                                    attributes.isSpecified(i));
                // identifier registration
                // REVISIT: try to retrieve XML Schema attribute declaration
                //          we should try to modify psvi API to allows to
                //          check if id type
                XSAttributeDeclaration xsDecl = (XSAttributeDeclaration)((attrPSVI!=null)?attrPSVI.getAttributeDeclaration():null);
               
                if (attributes.getType(i).equals("ID") ||
                    (xsDecl !=null && ((XSSimpleType)xsDecl.getTypeDefinition()).isIDType())) {
                    fDeferredDocumentImpl.setIdAttributeNode(el, attr);
                }
            }
            fDeferredDocumentImpl.appendChild(fCurrentNodeIndex, el);
            fCurrentNodeIndex = el;
View Full Code Here

TOP

Related Classes of org.apache.xerces.impl.xs.psvi.XSAttributeDeclaration

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.