XSLTAttributeDef hrefAttr = new XSLTAttributeDef(null, "href", XSLTAttributeDef.T_URL, true, false,XSLTAttributeDef.ERROR); XSLTAttributeDef elementsAttr = new XSLTAttributeDef(null, "elements", XSLTAttributeDef.T_SIMPLEPATTERNLIST, true, false, XSLTAttributeDef.ERROR); XSLTAttributeDef methodAttr = new XSLTAttributeDef(null, "method", XSLTAttributeDef.T_QNAME, false, false,XSLTAttributeDef.ERROR); XSLTAttributeDef versionAttr = new XSLTAttributeDef(null, "version", XSLTAttributeDef.T_NMTOKEN, false, false,XSLTAttributeDef.ERROR); XSLTAttributeDef encodingAttr = new XSLTAttributeDef(null, "encoding", XSLTAttributeDef.T_CDATA, false, false,XSLTAttributeDef.ERROR); XSLTAttributeDef omitXmlDeclarationAttr = new XSLTAttributeDef(null, "omit-xml-declaration", XSLTAttributeDef.T_YESNO, false, false,XSLTAttributeDef.ERROR); XSLTAttributeDef standaloneAttr = new XSLTAttributeDef(null, "standalone", XSLTAttributeDef.T_YESNO, false, false,XSLTAttributeDef.ERROR); XSLTAttributeDef doctypePublicAttr = new XSLTAttributeDef(null, "doctype-public", XSLTAttributeDef.T_CDATA, false, false,XSLTAttributeDef.ERROR); XSLTAttributeDef doctypeSystemAttr = new XSLTAttributeDef(null, "doctype-system", XSLTAttributeDef.T_CDATA, false, false,XSLTAttributeDef.ERROR); XSLTAttributeDef cdataSectionElementsAttr = new XSLTAttributeDef(null, "cdata-section-elements", XSLTAttributeDef.T_QNAMES_RESOLVE_NULL,
attrDef.setAttrValue(handler, attrUri, attrLocalName, attributes.getQName(i), attributes.getValue(i), target); String defVal = attrDef.getDefault(); attrDef.setDefAttrValue(handler, target); if (attrDef.getRequired()) XSLMessages.createMessage( XSLTErrorResources.ER_REQUIRES_ATTRIB, new Object[]{ rawName, attrDef.getName() }), null);
if (getSupportsAVT()) { try int retVal = this.getEnum(value); StringBuffer enumNamesList = getListOfEnums(); handleError(handler, XSLTErrorResources.INVALID_ENUM,new Object[]{name, value, enumNamesList.toString() },null); return null; if (getSupportsAVT()) return avt; else return new Integer(retVal);
/** * Set the default value of an attribute. * * @param handler non-null reference to current StylesheetHandler that is constructing the Templates. * @param elem The object on which the property will be set. * * @throws org.xml.sax.SAXException wraps an invocation exception if the * setter method can not be invoked on the object. */ void setDefAttrValue(StylesheetHandler handler, ElemTemplateElement elem) throws org.xml.sax.SAXException { setAttrValue(handler, this.getNamespace(), this.getName(), this.getName(), this.getDefault(), elem); }
return true; String setterString = getSetterMethodName(); Object value = processValue(handler, attrUri, attrLocalName, attrRawName, attrValue, elem); Class[] argTypes = new Class[]{ getPrimativeClass(value) }; handleError(handler, XSLTErrorResources.WG_ILLEGAL_ATTRIBUTE_VALUE, new Object[]{ Constants.ATTRNAME_NAME, getName()}, nsme); return false;
String uriDef = attrDef.getNamespace(); String nameDef = attrDef.getName();
private void handleError(StylesheetHandler handler, String msg, Object [] args, Exception exc) throws org.xml.sax.SAXException { switch (getErrorType()) { case (FATAL): case (ERROR): handler.error(msg, args, exc); break; case (WARNING): handler.warn(msg, args); default: break; } } }
/** * StringBuffer containing comma delimited list of valid values for ENUM type. * Used to build error message. */ private StringBuffer getListOfEnums() { StringBuffer enumNamesList = new StringBuffer(); String [] enumValues = this.getEnumNames(); for (int i = 0; i < enumValues.length; i++) { if (i > 0) { enumNamesList.append(' '); } enumNamesList.append(enumValues[i]); } return enumNamesList; }
return true; String setterString = getSetterMethodName(); Object value = processValue(handler, attrUri, attrLocalName, attrRawName, attrValue, elem); Class[] argTypes = new Class[]{ getPrimativeClass(value) }; handleError(handler, XSLTErrorResources.WG_ILLEGAL_ATTRIBUTE_VALUE, new Object[]{ Constants.ATTRNAME_NAME, getName()}, nsme); return false;
/** * Set the default value of an attribute. * * @param handler non-null reference to current StylesheetHandler that is constructing the Templates. * @param elem The object on which the property will be set. * * @throws org.xml.sax.SAXException wraps an invocation exception if the * setter method can not be invoked on the object. */ void setDefAttrValue(StylesheetHandler handler, ElemTemplateElement elem) throws org.xml.sax.SAXException { setAttrValue(handler, this.getNamespace(), this.getName(), this.getName(), this.getDefault(), elem); }
String uriDef = attrDef.getNamespace(); String nameDef = attrDef.getName();
private void handleError(StylesheetHandler handler, String msg, Object [] args, Exception exc) throws org.xml.sax.SAXException { switch (getErrorType()) { case (FATAL): case (ERROR): handler.error(msg, args, exc); break; case (WARNING): handler.warn(msg, args); default: break; } } }
/** * StringBuffer containing comma delimited list of valid values for ENUM type. * Used to build error message. */ private StringBuffer getListOfEnums() { StringBuffer enumNamesList = new StringBuffer(); String [] enumValues = this.getEnumNames(); for (int i = 0; i < enumValues.length; i++) { if (i > 0) { enumNamesList.append(' '); } enumNamesList.append(enumValues[i]); } return enumNamesList; }
boolean success = attrDef.setAttrValue(handler, attrUri, attrLocalName, attributes.getQName(i), attributes.getValue(i), target); String defVal = attrDef.getDefault(); attrDef.setDefAttrValue(handler, target); if (attrDef.getRequired()) XSLMessages.createMessage( XSLTErrorResources.ER_REQUIRES_ATTRIB, new Object[]{ rawName, attrDef.getName() }), null);
if (getSupportsAVT()) { try int retVal = this.getEnum(value); StringBuffer enumNamesList = getListOfEnums(); handleError(handler, XSLTErrorResources.INVALID_ENUM,new Object[]{name, value, enumNamesList.toString() },null); return null; if (getSupportsAVT()) return avt; else return new Integer(retVal);
return true; String setterString = getSetterMethodName(); Object value = processValue(handler, attrUri, attrLocalName, attrRawName, attrValue, elem); Class[] argTypes = new Class[]{ getPrimativeClass(value) }; handleError(handler, XSLTErrorResources.WG_ILLEGAL_ATTRIBUTE_VALUE, new Object[]{ Constants.ATTRNAME_NAME, getName()}, nsme); return false;
/** * Set the default value of an attribute. * * @param handler non-null reference to current StylesheetHandler that is constructing the Templates. * @param elem The object on which the property will be set. * * @throws org.xml.sax.SAXException wraps an invocation exception if the * setter method can not be invoked on the object. */ void setDefAttrValue(StylesheetHandler handler, ElemTemplateElement elem) throws org.xml.sax.SAXException { setAttrValue(handler, this.getNamespace(), this.getName(), this.getName(), this.getDefault(), elem); }
XSLTAttributeDef hrefAttr = new XSLTAttributeDef(null, "href", XSLTAttributeDef.T_URL, true, false,XSLTAttributeDef.ERROR); XSLTAttributeDef elementsAttr = new XSLTAttributeDef(null, "elements", XSLTAttributeDef.T_SIMPLEPATTERNLIST, true, false, XSLTAttributeDef.ERROR); XSLTAttributeDef methodAttr = new XSLTAttributeDef(null, "method", XSLTAttributeDef.T_QNAME, false, false,XSLTAttributeDef.ERROR); XSLTAttributeDef versionAttr = new XSLTAttributeDef(null, "version", XSLTAttributeDef.T_NMTOKEN, false, false,XSLTAttributeDef.ERROR); XSLTAttributeDef encodingAttr = new XSLTAttributeDef(null, "encoding", XSLTAttributeDef.T_CDATA, false, false,XSLTAttributeDef.ERROR); XSLTAttributeDef omitXmlDeclarationAttr = new XSLTAttributeDef(null, "omit-xml-declaration", XSLTAttributeDef.T_YESNO, false, false,XSLTAttributeDef.ERROR); XSLTAttributeDef standaloneAttr = new XSLTAttributeDef(null, "standalone", XSLTAttributeDef.T_YESNO, false, false,XSLTAttributeDef.ERROR); XSLTAttributeDef doctypePublicAttr = new XSLTAttributeDef(null, "doctype-public", XSLTAttributeDef.T_CDATA, false, false,XSLTAttributeDef.ERROR); XSLTAttributeDef doctypeSystemAttr = new XSLTAttributeDef(null, "doctype-system", XSLTAttributeDef.T_CDATA, false, false,XSLTAttributeDef.ERROR); XSLTAttributeDef cdataSectionElementsAttr = new XSLTAttributeDef(null, "cdata-section-elements", XSLTAttributeDef.T_QNAMES_RESOLVE_NULL,
String uriDef = attrDef.getNamespace(); String nameDef = attrDef.getName();
private void handleError(StylesheetHandler handler, String msg, Object [] args, Exception exc) throws org.xml.sax.SAXException { switch (getErrorType()) { case (FATAL): case (ERROR): handler.error(msg, args, exc); break; case (WARNING): handler.warn(msg, args); default: break; } } }