Examples of XSTypeAlternativeImpl


Examples of org.apache.xerces.impl.xs.alternative.XSTypeAlternativeImpl

            //to the default type definition attribute
            if (fTypeAlternatives[fTypeAlternativePos-1].getTest() == null) {
                fDefaultTypeDef = fTypeAlternatives[fTypeAlternativePos-1];
            }
            else {
                fDefaultTypeDef = new XSTypeAlternativeImpl(fName, fType, XSObjectListImpl.EMPTY_LIST);
            }
        }
    }
View Full Code Here

Examples of org.apache.xerces.impl.xs.alternative.XSTypeAlternativeImpl

            //reportSchemaError("s4s-elt-must-match.1", new Object[] { "type alternative", "(annotation?, (simpleType|complexType)?)", childNode.getLocalName() }, altElement);
            reportSchemaError("s4s-elt-must-match.1", new Object[]{"type alternative", "(annotation?, (simpleType | complexType)?)", DOMUtil.getLocalName(childNode)}, childNode);
        }

        // create type alternative
        XSTypeAlternativeImpl typeAlternative = new XSTypeAlternativeImpl(element.fName, alternativeType, annotations);

        // now look for other optional attributes like test and xpathDefaultNamespace
        if (test != null) {
            Test testExpr = null;
            //set the test attribute value
            try {
               testExpr = new Test(new XPath20(test, fSymbolTable, schemaDoc.fNamespaceSupport),
                                       typeAlternative,
                                       schemaDoc.fNamespaceSupport);
            }
            catch (XPathException e) {
               // fall back to full XPath 2.0 support, with PsychoPath engine
               try {
                  XPathParser xpp = new JFlexCupParser();
                  XPath xp = xpp.parse("boolean(" + test + ")");
                  testExpr = new Test(xp, typeAlternative, schemaDoc.fNamespaceSupport);
               } catch(XPathParserException ex) {
                  reportSchemaError("c-cta-xpath", new Object[] { test }, altElement);
                  //if the XPath is invalid, create a Test without an expression
                  testExpr = new Test((XPath20) null, typeAlternative,
                                       schemaDoc.fNamespaceSupport);
               }               
            }           
            typeAlternative.setTest(testExpr);
        }

        if (xpathNS != null) {
            //set the xpathDefaultNamespace attribute value
            typeAlternative.setXPathDefauleNamespace(xpathNS);
        }
       
        grammar.addTypeAlternative(element, typeAlternative);
        fAttrChecker.returnAttrArray(attrValues, schemaDoc);
    }
View Full Code Here

Examples of org.apache.xerces.impl.xs.alternative.XSTypeAlternativeImpl

                    break;
                }
            }
            //if a type is not selected try to assign the default type
            if (!typeSelected) {
                XSTypeAlternativeImpl defType = currentElemDecl.getDefaultTypeDefinition();
                if (defType != null) {
                    currentType = defType.getTypeDefinition();
                }
            }
        }
       
        return currentType;
View Full Code Here

Examples of org.apache.xerces.impl.xs.alternative.XSTypeAlternativeImpl

                        break;
                    }
                }
                //if a type is not selected try to assign the default type
                if (!typeSelected) {
                    XSTypeAlternativeImpl defType = fCurrentElemDecl.getDefaultTypeDefinition();
                    if (defType != null) {
                        fCurrentType = defType.getTypeDefinition();
                    }
                }
            }           
        }
View Full Code Here

Examples of org.apache.xerces.impl.xs.alternative.XSTypeAlternativeImpl

            //to the default type definition attribute
            if (fTypeAlternatives[fTypeAlternativePos-1].getTest() == null) {
                fDefaultTypeDef = fTypeAlternatives[fTypeAlternativePos-1];
            }
            else {
                fDefaultTypeDef = new XSTypeAlternativeImpl(fName, fType, XSObjectListImpl.EMPTY_LIST);
            }
        }
    }
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.