Examples of ElementPSVI


Examples of mf.org.apache.xerces.xs.ElementPSVI

    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

Examples of mf.org.apache.xerces.xs.ElementPSVI

        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);
                }
                // Updating the TypeInfo for this element.
                if (elementNode instanceof ElementNSImpl) {
                    XSTypeDefinition type = elementPSVI.getMemberTypeDefinition();
                    if (type == null) {
                        type = elementPSVI.getTypeDefinition();
                    }
                    ((ElementNSImpl) elementNode).setType(type);
                }
                // 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

Examples of mf.org.apache.xerces.xs.ElementPSVI

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

Examples of mf.org.apache.xerces.xs.ElementPSVI

        }
        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);
                    }
                }
            }

            if (fDOMFilter != null) {
                if (fFilterReject) {
                    if (fRejectedElementDepth-- == 0) {
                        fFilterReject = false;
                    }
                    return;
                }
                if (!fSkippedElemStack.isEmpty()) {
                    if (fSkippedElemStack.pop() == Boolean.TRUE) {
                        return;
                    }
                }
                setCharacterData (false);
                if ((fCurrentNode != fRoot) && !fInEntityRef && (fDOMFilter.getWhatToShow () & NodeFilter.SHOW_ELEMENT)!=0) {
                    short code = fDOMFilter.acceptNode (fCurrentNode);
                    switch (code) {
                        case LSParserFilter.FILTER_INTERRUPT:{
                            throw Abort.INSTANCE;
                        }
                        case LSParserFilter.FILTER_REJECT:{
                            Node parent = fCurrentNode.getParentNode ();
                            parent.removeChild (fCurrentNode);
                            fCurrentNode = parent;
                            return;
                        }
                        case LSParserFilter.FILTER_SKIP: {
                            // make sure that if any char data is available
                            // the fFirstChunk is true, so that if the next event
                            // is characters(), and the last node is text, we will copy
                            // the value already in the text node to fStringBuffer
                            // (not to lose it).
                            fFirstChunk = true;

                            // replace children
                            Node parent = fCurrentNode.getParentNode ();
                            NodeList ls = fCurrentNode.getChildNodes ();
                            int length = ls.getLength ();

                            for (int i=0;i<length;i++) {
                                parent.appendChild (ls.item (0));
                            }
                            parent.removeChild (fCurrentNode);
                            fCurrentNode = parent;

                            return;
                        }

                        default: { }
                    }
                }
                fCurrentNode = fCurrentNode.getParentNode ();

            } // end-if DOMFilter
            else {
                setCharacterData (false);
                fCurrentNode = fCurrentNode.getParentNode ();
            }

        }
        else {
            if (augs != null) {
                ElementPSVI elementPSVI = (ElementPSVI) augs.getItem(Constants.ELEMENT_PSVI);
                if (elementPSVI != null) {
                    // Setting TypeInfo. If the declared type is a union the
                    // [member type definition] will only be available at the
                    // end of an element.
                    XSTypeDefinition type = elementPSVI.getMemberTypeDefinition();
                    if (type == null) {
                        type = elementPSVI.getTypeDefinition();
                    }
                    fDeferredDocumentImpl.setTypeInfo(fCurrentNodeIndex, type);
                }
            }
            fCurrentNodeIndex =
View Full Code Here

Examples of org.apache.xerces.xni.psvi.ElementPSVI

        //          each character. However, it also says:
        // "Each character is a logically separate information item,
        //  but XML applications are free to chunk characters into larger
        //  groups as necessary or desirable"
        //  XSV outputs each character separately.
        ElementPSVI elemPSVI = (ElementPSVI)augs.getItem(Constants.ELEMENT_PSVI);
       
        checkForChildren();
        if (elemPSVI != null) {
            if (elemPSVI.isSpecified()){  // value was specified in the instance!
                printIndentTag("<character>");
                printElement("characterCode", text.toString());
                printElement("elementContentWhitespace", "false");
                printUnIndentTag("</character>");
            }
View Full Code Here

Examples of org.apache.xerces.xni.psvi.ElementPSVI

    * The following information will be available at the endElement call:
    * nil, specified, normalized value, member type, validity, error codes,
    * default
    */
    public void printPSVIStartElement(Augmentations augs) {
        ElementPSVI elemPSVI =(ElementPSVI)augs.getItem(Constants.ELEMENT_PSVI);
        if (elemPSVI != null) {

            // REVISIT: Should we store the values till end element call?
            printElement("psv:validationContext",elemPSVI.getValidationContext());


            short definationType = elemPSVI.getTypeDefinitionType();
            if (definationType == XSTypeDecl.SIMPLE_TYPE) {
                printElement("psv:typeDefinitionType","simple");
            }
            else if (definationType == XSTypeDecl.COMPLEX_TYPE) {
                printElement("psv:typeDefinitionType","complex");
            }
            printElement("psv:typeDefinitionNamespace ",elemPSVI.getTypeNamespace());
            printElement("psv:typeDefinitionAnonymous",String.valueOf(elemPSVI.isTypeAnonymous()));

            printElement("psv:typeDefinitionName",(elemPSVI.isTypeAnonymous())?null:elemPSVI.getTypeName());
            printElement("psv:memberTypeDefinitionAnonymous",String.valueOf(elemPSVI.isMemberTypeAnonymous()));
            printElement("psv:memberTypeDefinitionName",(elemPSVI.isMemberTypeAnonymous())?null:elemPSVI.getMemberTypeName());
            printElement("psv:memberTypeDefinitionNamespace",elemPSVI.getMemberTypeNamespace());
            printElement("psv:notationSystem",elemPSVI.getNotationSystemId());
            printElement("psv:notationPublic",elemPSVI.getNotationPublicId());
        }
    }
View Full Code Here

Examples of org.apache.xerces.xni.psvi.ElementPSVI

    * The following information will be available at the endElement call:
    * nil, specified, normalized value, member type, validity, error codes,
    * default
    */
    public void printPSVIEndElement(Augmentations augs) {
        ElementPSVI elemPSVI = (ElementPSVI)augs.getItem(Constants.ELEMENT_PSVI);
        if (elemPSVI != null) {


            short validation = elemPSVI.getValidationAttempted();
            if (validation == ItemPSVI.NO_VALIDATION) {
                printElement("psv:validationAttempted","none");
            }
            else if (validation == ItemPSVI.PARTIAL_VALIDATION) {
                printElement("psv:validationAttempted","partial");
            }
            else if (validation == ItemPSVI.FULL_VALIDATION) {
                printElement("psv:validationAttempted","full");
            }


            short validity = elemPSVI.getValidity();
            if (validity == ItemPSVI.UNKNOWN_VALIDITY) {
                printElement("psv:validity","unknown");
            }
            else if (validity == ItemPSVI.VALID_VALIDITY) {
                printElement("psv:validity","valid");
            }
            else if (validity == ItemPSVI.INVALID_VALIDITY) {
                printElement("psv:validity","invalid");
            }
            //revisit
            String [] errorCode = elemPSVI.getErrorCodes();
            if (errorCode != null) {
                int  errorCount = errorCode.length;
               
                for (int i=0;i< errorCount; i++) {
                    fErrorBuffer.append(errorCode[i]);
                    fErrorBuffer.append(" ");
                }
                printElement("psv:schemaErrorCode",fErrorBuffer.toString());
                fErrorBuffer.setLength(0);
            }
            else {
                printElement("psv:schemaErrorCode","");
            }
            printElement("psv:nil", String.valueOf(elemPSVI.isNil()));
            printElement("psv:schemaNormalizedValue",elemPSVI.getSchemaNormalizedValue());
            String specified = elemPSVI.isSpecified()?"infoset":"schema";
            printElement("psv:schemaSpecified",specified);

        }
    }
View Full Code Here

Examples of org.apache.xerces.xni.psvi.ElementPSVI

        printIndent();
        fOut.print("characters(");
        fOut.print("text=");
        printQuotedString(text.ch, text.offset, text.length);
        if (augs != null) {
            ElementPSVI element = (ElementPSVI)augs.getItem(Constants.ELEMENT_PSVI);
            fOut.print(" schemaNormalized=");
            printQuotedString(element.getSchemaNormalizedValue());
        }
       
        fOut.println(')');
        fOut.flush();
View Full Code Here

Examples of org.apache.xerces.xni.psvi.ElementPSVI

                }
            }
            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) {
                short code = fDOMFilter.startElement(el);
                switch (code) {
                    case DOMParserFilter.FILTER_INTERRUPT:{
                        throw new RuntimeException("The normal processing of the document was interrupted.");
                    }  
                    case DOMParserFilter.FILTER_REJECT:{
                        fFilterReject = true;
                        fRejectedElement.setValues(element);
                        return;
                    }
                    case DOMParserFilter.FILTER_SKIP: {
                        fSkippedElemStack.push(element);
                        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

Examples of org.apache.xerces.xni.psvi.ElementPSVI

        }
        if (!fDeferNodeExpansion) {
           
            // REVISIT: Should this happen after we call the filter?
            if (fStorePSVI && augs != null) {
                ElementPSVI elementPSVI = (ElementPSVI)augs.getItem(Constants.ELEMENT_PSVI);
                if (elementPSVI != null) {
                    ((PSVIElementNSImpl)fCurrentNode).setPSVI(elementPSVI);
                }
            }
           
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.