Package org.apache.xerces.impl.dv

Examples of org.apache.xerces.impl.dv.XSSimpleType.validate()


                                attrValues[ATTIDX_SUBSGROUP] = new Vector();
                            }
                            if (fSchemaHandler.fSchemaVersion == Constants.SCHEMA_VERSION_1_1) {
                                StringTokenizer st = new StringTokenizer(attrVal, " \n\t\r");
                                while (st.hasMoreTokens()) {
                                    Object avalue = dv.validate(st.nextToken(), schemaDoc.fValidationContext, null);
                                    ((Vector)attrValues[ATTIDX_SUBSGROUP]).addElement(avalue);
                                }
                            }
                            else {
                                Object avalue = dv.validate(attrVal, schemaDoc.fValidationContext, null);
View Full Code Here


                                    Object avalue = dv.validate(st.nextToken(), schemaDoc.fValidationContext, null);
                                    ((Vector)attrValues[ATTIDX_SUBSGROUP]).addElement(avalue);
                                }
                            }
                            else {
                                Object avalue = dv.validate(attrVal, schemaDoc.fValidationContext, null);
                                ((Vector)attrValues[ATTIDX_SUBSGROUP]).addElement(avalue);
                            }
                        }
                        else {
                            Object avalue = dv.validate(attrVal, schemaDoc.fValidationContext, null);
View Full Code Here

                                Object avalue = dv.validate(attrVal, schemaDoc.fValidationContext, null);
                                ((Vector)attrValues[ATTIDX_SUBSGROUP]).addElement(avalue);
                            }
                        }
                        else {
                            Object avalue = dv.validate(attrVal, schemaDoc.fValidationContext, null);
                            // kludge to handle chameleon includes/redefines...
                            if (oneAttr.dvIndex == DT_QNAME) {
                                QName qname = (QName)avalue;
                                if(qname.prefix == XMLSymbols.EMPTY_STRING && qname.uri == null && schemaDoc.fIsChameleonSchema)
                                    qname.uri = schemaDoc.fTargetNamespace;
View Full Code Here

                elName = (String)values.elementAt(i);
                try {
                    // and validate it using the XSSimpleType
                    // REVISIT: what would be the proper validation context?
                    //          guess we need to save that in the vectors too.
                    dv.validate((String)values.elementAt(i+1), null, null);
                } catch(InvalidDatatypeValueException ide) {
                    reportSchemaError ("s4s-att-invalid-value",
                                       new Object[] {elName, attrName, ide.getMessage()},
                                       null);
                }
View Full Code Here

      ValidatedInfo validatedInfo = new ValidatedInfo();
      ValidationContext validationState = new ValidationState();

      try
      {
          simpleType.validate(value, validationState, validatedInfo);
      }
      catch(InvalidDatatypeValueException ex)
      {
          return ObjUtil.getMessage(ex);
      }
View Full Code Here

            // "string" type for validation
            dv = STRING_TYPE;
        }
        try {
            // validate the original lexical rep, and set the actual value
            actualValue = dv.validate(value, context, vinfo);
            // validate the canonical lexical rep
            if (vinfo != null)
                actualValue = dv.validate(vinfo.stringValue(), context, vinfo);
        } catch (InvalidDatatypeValueException ide) {
            return null;
View Full Code Here

        try {
            // validate the original lexical rep, and set the actual value
            actualValue = dv.validate(value, context, vinfo);
            // validate the canonical lexical rep
            if (vinfo != null)
                actualValue = dv.validate(vinfo.stringValue(), context, vinfo);
        } catch (InvalidDatatypeValueException ide) {
            return null;
        }

        return actualValue;
View Full Code Here

        // get simple type
        XSSimpleType attDV = currDecl.fType;

        Object actualValue = null;
        try {
            actualValue = attDV.validate(attrValue, fValidationState, fValidatedInfo);
            // store the normalized value
            if (fNormalizeData)
                attributes.setValue(index, fValidatedInfo.normalizedValue);
            if (attributes instanceof XMLAttributesImpl) {
                XMLAttributesImpl attrs = (XMLAttributesImpl) attributes;
View Full Code Here

                XSSimpleType dv = (XSSimpleType) fCurrentType;
                try {
                    if (!fNormalizeData || fUnionType) {
                        fValidationState.setNormalizationRequired(true);
                    }
                    retValue = dv.validate(textContent, fValidationState, fValidatedInfo);
                } catch (InvalidDatatypeValueException e) {
                    reportSchemaError(e.getKey(), e.getArgs());
                    reportSchemaError(
                        "cvc-type.3.1.3",
                        new Object[] { element.rawname, textContent });
View Full Code Here

                XSSimpleType dv = ctype.fXSSimpleType;
                try {
                    if (!fNormalizeData || fUnionType) {
                        fValidationState.setNormalizationRequired(true);
                    }
                    actualValue = dv.validate(textContent, fValidationState, fValidatedInfo);
                } catch (InvalidDatatypeValueException e) {
                    reportSchemaError(e.getKey(), e.getArgs());
                    reportSchemaError("cvc-complex-type.2.2", new Object[] { element.rawname });
                }
                // REVISIT: eventually, this method should return the same actualValue as elementLocallyValidType...
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.