Package org.apache.xerces.impl.xs

Examples of org.apache.xerces.impl.xs.SchemaNamespaceSupport


        }
    }

    void backupNSSupport() {
        SchemaNamespaceSupportStack.push(fNamespaceSupport);
        fNamespaceSupport = new SchemaNamespaceSupport(fNamespaceSupportRoot);
        fValidationContext.setNamespaceSupport(fNamespaceSupport);
    }
View Full Code Here


        return sb.toString();
    }

    // REVISIT: should remove this method once the DVs return compiled value
    protected QName resolveQName (String attrVal, XSDocumentInfo currSchema) {
        SchemaNamespaceSupport nsSupport = currSchema.fNamespaceSupport;
        String prefix = fSchemaHandler.EMPTY_STRING;
        String localpart = attrVal;
        int colonptr = attrVal.indexOf(":");
        if ( colonptr > 0) {
            prefix = fSymbolTable.addSymbol(attrVal.substring(0,colonptr));
            localpart = attrVal.substring(colonptr+1);
        }
        String uri = nsSupport.getURI(prefix);
        // kludge to handle chameleon includes/redefines...
        if(prefix == fSchemaHandler.EMPTY_STRING && uri == null && currSchema.fIsChameleonSchema)
            uri = currSchema.fTargetNamespace;
        return new QName(prefix, localpart, attrVal, uri);
    }
View Full Code Here

    // traversers.
    private void renameRedefiningComponents(XSDocumentInfo currSchema,
                                            Element child, String componentType,
                                            String oldName, String newName) {

        SchemaNamespaceSupport currNSMap = currSchema.fNamespaceSupport;
        if (componentType.equals(SchemaSymbols.ELT_SIMPLETYPE)) {
            String processedTypeName = currSchema.fTargetNamespace == null?
                                       ","+oldName:currSchema.fTargetNamespace+","+oldName;
            Element grandKid = DOMUtil.getFirstChildElement(child);
            if (grandKid == null) {
View Full Code Here

    //          as a key to the SymbolHash.
    //          And when the DV's are ready to return compiled values from
    //          validate() method, we should just call QNameDV.validate()
    //          in this method.
    private String findQName(String name, XSDocumentInfo schemaDoc) {
        SchemaNamespaceSupport currNSMap = schemaDoc.fNamespaceSupport;
        int colonPtr = name.indexOf(':');
        String prefix = EMPTY_STRING;
        if (colonPtr > 0)
            prefix = name.substring(0, colonPtr);
        String uri = currNSMap.getURI(fSymbolTable.addSymbol(prefix));
        String localpart = (colonPtr == 0)?name:name.substring(colonPtr+1);
        if (prefix == this.EMPTY_STRING && uri == null && schemaDoc.fIsChameleonSchema)
            uri = schemaDoc.fTargetNamespace;
        if (uri == null)
            return ","+localpart;
View Full Code Here

    // the sum of the values returned by calls to itself on curr's children.
    // It also resets the value of ref so that it will refer to the renamed type from the schema
    // being redefined.
    private int changeRedefineGroup(String originalQName, String elementSought,
                                    String newName, Element curr, XSDocumentInfo schemaDoc) {
        SchemaNamespaceSupport currNSMap = schemaDoc.fNamespaceSupport;
        int result = 0;
        for (Element child = DOMUtil.getFirstChildElement(curr);
            child != null; child = DOMUtil.getNextSiblingElement(child)) {
            String name = child.getLocalName();
            if (!name.equals(elementSought))
View Full Code Here

                    // create an assertion object
                    XSAssertImpl assertImpl = new XSAssertImpl(typeDef,
                                                           annotations,
                                                           fSchemaHandler);
                    Test testExpr = new Test(new XPath20Assert(test, fSymbolTable,
                                             new SchemaNamespaceSupport(schemaDoc.
                                             fNamespaceSupport)), assertImpl);                
                    assertImpl.setAssertKind(XSConstants.ASSERTION_FACET);
                    assertImpl.setTest(testExpr);
                    assertImpl.setXPathDefaultNamespace(xpathDefaultNamespace);
                    assertImpl.setXPath2NamespaceContext(new SchemaNamespaceSupport
                                                     (schemaDoc.fNamespaceSupport));
                    String assertMessage = XMLChar.trim(content.getAttributeNS(
                                                SchemaSymbols.URI_XERCES_EXTENSIONS,
                                                SchemaSymbols.ATT_ASSERT_MESSAGE));
                    if (!"".equals(assertMessage)) {
View Full Code Here

            // create an assertion object           
            XSAssertImpl assertImpl = new XSAssertImpl(enclosingCT,
                                                       annotations,
                                                       fSchemaHandler);
            Test testExpr = new Test(new XPath20Assert(test, fSymbolTable,
                                     new SchemaNamespaceSupport(schemaDoc.
                                     fNamespaceSupport)), assertImpl);
            assertImpl.setTest(testExpr);
            assertImpl.setXPathDefaultNamespace(xpathDefaultNamespace);
            assertImpl.setXPath2NamespaceContext(new SchemaNamespaceSupport
                                            (schemaDoc.fNamespaceSupport));
            String assertMessage = XMLChar.trim(assertElement.getAttributeNS(
                                          SchemaSymbols.URI_XERCES_EXTENSIONS,
                                          SchemaSymbols.ATT_ASSERT_MESSAGE));
            if (!"".equals(assertMessage)) {
View Full Code Here

                // yet).
                Object[] includeAttrs = fAttributeChecker.checkAttributes(child, true, currSchemaInfo);
                schemaHint = (String)includeAttrs[XSAttributeChecker.ATTIDX_SCHEMALOCATION];
                // store the namespace decls of the redefine element
                if (localName.equals(SchemaSymbols.ELT_REDEFINE)) {
                    fRedefine2NSSupport.put(child, new SchemaNamespaceSupport(currSchemaInfo.fNamespaceSupport));
                }
               
                // check annotations.  Must do this here to avoid having to
                // re-parse attributes later
                if(localName.equals(SchemaSymbols.ELT_INCLUDE)) {
View Full Code Here

            reportSchemaError(code, new Object [] {declToTraverse.prefix+":"+declToTraverse.localpart}, elmNode);
            return null;
        }
       
        DOMUtil.setHidden(decl, fHiddenNodes);
        SchemaNamespaceSupport nsSupport = null;
        // if the parent is <redefine> use the namespace delcs for it.
        Element parent = DOMUtil.getParent(decl);
        if (DOMUtil.getLocalName(parent).equals(SchemaSymbols.ELT_REDEFINE))
            nsSupport = (SchemaNamespaceSupport)fRedefine2NSSupport.get(parent);
        // back up the current SchemaNamespaceSupport, because we need to provide
View Full Code Here

    //          as a key to the SymbolHash.
    //          And when the DV's are ready to return compiled values from
    //          validate() method, we should just call QNameDV.validate()
    //          in this method.
    private String findQName(String name, XSDocumentInfo schemaDoc) {
        SchemaNamespaceSupport currNSMap = schemaDoc.fNamespaceSupport;
        int colonPtr = name.indexOf(':');
        String prefix = XMLSymbols.EMPTY_STRING;
        if (colonPtr > 0)
            prefix = name.substring(0, colonPtr);
        String uri = currNSMap.getURI(fSymbolTable.addSymbol(prefix));
        String localpart = (colonPtr == 0)?name:name.substring(colonPtr+1);
        if (prefix == XMLSymbols.EMPTY_STRING && uri == null && schemaDoc.fIsChameleonSchema)
            uri = schemaDoc.fTargetNamespace;
        if (uri == null)
            return ","+localpart;
View Full Code Here

TOP

Related Classes of org.apache.xerces.impl.xs.SchemaNamespaceSupport

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.