Package org.apache.xerces.xs

Examples of org.apache.xerces.xs.ElementPSVI


    * default
    */
    private void processPSVIEndElement(Augmentations augs) {
        if (augs == null)
            return;
        ElementPSVI elemPSVI =
            (ElementPSVI)augs.getItem(Constants.ELEMENT_PSVI);
        if (elemPSVI != null) {

            processPSVISchemaInformation(elemPSVI);
            sendElementEvent(
                "psv:validationAttempted",
                this.translateValidationAttempted(
                    elemPSVI.getValidationAttempted()));
            // Would rather getValidationContext() return element info item.
            // This is non the same as XSV.
            sendElementEvent(
                "psv:validationContext",
                elemPSVI.getValidationContext());

            sendElementEvent(
                "psv:validity",
                this.translateValidity(elemPSVI.getValidity()));

            processPSVISchemaErrorCode(elemPSVI.getErrorCodes());
            sendElementEvent(
                "psv:schemaNormalizedValue",
                elemPSVI.getSchemaNormalizedValue());
            sendElementEvent(
                "psv:schemaSpecified",
                elemPSVI.getIsSchemaSpecified() ? "schema" : "infoset");
            sendElementEvent("psv:schemaDefault", elemPSVI.getSchemaDefault());

            processPSVITypeDefinitionRef(
                "psv:typeDefinition",
                elemPSVI.getTypeDefinition());
            processPSVITypeDefinitionRef(
                "psv:memberTypeDefinition",
                elemPSVI.getMemberTypeDefinition());
            // A value for nil is not necessary, since we output declaration, instead.
            // See http://www.w3.org/TR/xmlschema-1/#section-Element-Declaration-Information-Set-Contributions.
            sendElementEvent("psv:nil");

            sendIndentedElement("psv:declaration");
            processPSVIElementRef(
                "psv:elementDeclaration",
                elemPSVI.getElementDeclaration());
            sendUnIndentedElement("psv:declaration");
            processPSVIElementRef("psv:notation", elemPSVI.getNotation());
            // idref table does not have to be exposed, and is not exposed
            sendElementEvent("psv:idIdrefTable");
            // identity constraint table does not have to be exposed, and is not exposed
            sendElementEvent("psv:identityConstraintTable");
        }
View Full Code Here


        public TypeInfo getElementTypeInfo() {
            checkStateElement();
            if (fElementAugs == null) {
                return null;
            }
            ElementPSVI psvi = (ElementPSVI)fElementAugs.getItem(Constants.ELEMENT_PSVI);
            return getTypeInfoFromPSVI(psvi);
        }
View Full Code Here

    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);
            }
        }
    }
View Full Code Here

                }
            }
            setCharacterData (false);

            if (augs != null) {
                ElementPSVI elementPSVI = (ElementPSVI)augs.getItem (Constants.ELEMENT_PSVI);
                if (elementPSVI != null && fNamespaceAware) {
                    XSTypeDefinition type = elementPSVI.getMemberTypeDefinition ();
                    if (type == null) {
                        type = elementPSVI.getTypeDefinition ();
                    }
                    ((ElementNSImpl)el).setType (type);
                }
            }


            // filter nodes
            if (fDOMFilter != null && !fInEntityRef) {
                if (fRoot.rawname == null) {
                    // fill value of the root element
                    fRoot.setValues(element);
                } else {
                    short code = fDOMFilter.startElement(el);
                    switch (code) {
                        case LSParserFilter.FILTER_INTERRUPT :
                            {
                                throw abort;
                            }
                        case LSParserFilter.FILTER_REJECT :
                            {
                                fFilterReject = true;
                                fRejectedElement.setValues(element);
                                return;
                            }
                        case LSParserFilter.FILTER_SKIP :
                            {
                                fSkippedElemStack.push(element.clone());
                                return;
                            }
                        default : {}
                    }
                }
            }
            fCurrentNode.appendChild (el);
            fCurrentNode = el;
        }
        else {
            Object type = null;
            if (augs != null) {
                ElementPSVI elementPSVI = (ElementPSVI)augs.getItem (Constants.ELEMENT_PSVI);
                if (elementPSVI != null) {
                    type = elementPSVI.getMemberTypeDefinition ();
                    if (type == null) {
                        type = elementPSVI.getTypeDefinition ();
                    }
                }
            }

            int el =
View Full Code Here

        }
        if (!fDeferNodeExpansion) {

            // REVISIT: Should this happen after we call the filter?
            if (augs != null && fDocumentImpl != null && (fNamespaceAware || fStorePSVI)) {
                ElementPSVI elementPSVI = (ElementPSVI) augs.getItem(Constants.ELEMENT_PSVI);
                if (elementPSVI != null) {
                    // Updating TypeInfo. If the declared type is a union the
                    // [member type definition] will only be available at the
                    // end of an element.
                    if (fNamespaceAware) {
                        XSTypeDefinition type = elementPSVI.getMemberTypeDefinition();
                        if (type == null) {
                            type = elementPSVI.getTypeDefinition();
                        }
                        ((ElementNSImpl)fCurrentNode).setType(type);
                    }
                    if (fStorePSVI) {
                        ((PSVIElementNSImpl)fCurrentNode).setPSVI (elementPSVI);
View Full Code Here

        }
       
        public TypeInfo getElementTypeInfo() {
            checkState();
            if (fElementAugs == null) return null;
            ElementPSVI psvi = (ElementPSVI)fElementAugs.getItem(Constants.ELEMENT_PSVI);
            return getTypeInfoFromPSVI(psvi);
        }
View Full Code Here

    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);
            }
        }
    }
View Full Code Here

    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 {
View Full Code Here

    * default
    */
    private void processPSVIStartElement(Augmentations augs) {
        if (augs == null)
            return;
        ElementPSVI elemPSVI =
            (ElementPSVI)augs.getItem(Constants.ELEMENT_PSVI);
        if (elemPSVI != null) {
            // Should we store the values till end element call? -- AY
            // I don't think so -- PJM
        }
View Full Code Here

    * default
    */
    private void processPSVIEndElement(Augmentations augs) {
        if (augs == null)
            return;
        ElementPSVI elemPSVI =
            (ElementPSVI)augs.getItem(Constants.ELEMENT_PSVI);
        if (elemPSVI != null) {

            processPSVISchemaInformation(elemPSVI);
            sendElementEvent(
                "psv:validationAttempted",
                this.translateValidationAttempted(
                    elemPSVI.getValidationAttempted()));
            // Would rather getValidationContext() return element info item.
            // This is non the same as XSV.
            sendElementEvent(
                "psv:validationContext",
                elemPSVI.getValidationContext());

            sendElementEvent(
                "psv:validity",
                this.translateValidity(elemPSVI.getValidity()));

            processPSVISchemaErrorCode(elemPSVI.getErrorCodes());
            sendElementEvent(
                "psv:schemaNormalizedValue",
                elemPSVI.getSchemaNormalizedValue());
            sendElementEvent(
                "psv:schemaSpecified",
                elemPSVI.getIsSchemaSpecified() ? "schema" : "infoset");
            sendElementEvent("psv:schemaDefault", elemPSVI.getSchemaDefault());

            processPSVITypeDefinitionRef(
                "psv:typeDefinition",
                elemPSVI.getTypeDefinition());
            processPSVITypeDefinitionRef(
                "psv:memberTypeDefinition",
                elemPSVI.getMemberTypeDefinition());
            // A value for nil is not necessary, since we output declaration, instead.
            // See http://www.w3.org/TR/xmlschema-1/#section-Element-Declaration-Information-Set-Contributions.
            sendElementEvent("psv:nil");

            sendIndentedElement("psv:declaration");
            processPSVIElementRef(
                "psv:elementDeclaration",
                elemPSVI.getElementDeclaration());
            sendUnIndentedElement("psv:declaration");
            processPSVIElementRef("psv:notation", elemPSVI.getNotation());
            // idref table does not have to be exposed, and is not exposed
            sendElementEvent("psv:idIdrefTable");
            // identity constraint table does not have to be exposed, and is not exposed
            sendElementEvent("psv:identityConstraintTable");
        }
View Full Code Here

TOP

Related Classes of org.apache.xerces.xs.ElementPSVI

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.