if (!equalsMayBeNullOrZeroLen(uri, Constants.S_XSLNAMESPACEURL)) order = def.getOrder(); multiAllowed = def.getMultiAllowed(); else if (def.QNameEquals(uri, localName)) if (def.getRequired()) this.setRequiredFound(def.getName(), true); order = def.getOrder(); multiAllowed = def.getMultiAllowed(); elemDef = def.m_elementProcessor; break; if (elemDef != null && this.isOrdered()) int lastOrder = getLastOrder(); if (order > lastOrder) setLastOrder(order); else if (order == lastOrder && !multiAllowed)
/** * Construct an instance of XSLTElementDef. * * @param namespace The Namespace URI, "*", or null. * @param name The local name (without prefix), "*", or null. * @param nameAlias A potential alias for the name, or null. * @param elements An array of allowed child element defs, or null. * @param attributes An array of allowed attribute defs, or null. * @param contentHandler The element processor for this element. * @param classObject The class of the object that this element def should produce. */ XSLTElementDef(XSLTSchema schema, String namespace, String name, String nameAlias, XSLTElementDef[] elements, XSLTAttributeDef[] attributes, XSLTElementProcessor contentHandler, Class classObject) { build(namespace, name, nameAlias, elements, attributes, contentHandler, classObject); if ( (null != namespace) && (namespace.equals(Constants.S_XSLNAMESPACEURL) || namespace.equals(Constants.S_BUILTIN_EXTENSIONS_URL) || namespace.equals(Constants.S_BUILTIN_OLD_EXTENSIONS_URL))) { schema.addAvailableElement(new QName(namespace, name)); if(null != nameAlias) schema.addAvailableElement(new QName(namespace, nameAlias)); } }
XSLTAttributeDef attrDef = def.getAttributeDef(attrUri, attrLocalName); XSLTAttributeDef[] attrDefs = def.getAttributes(); int nAttrDefs = attrDefs.length;
this.m_attributes = attributes; setElementProcessor(contentHandler); if (hasRequired() && m_elements != null) if (def != null && def.getRequired()) m_requiredFound.put(def.getName(), "xsl:" +def.getName());
XSLTAttributeDef[] attrDefs = getAttributes(); int nAttrDefs = attrDefs.length; String nameDef = attrDef.getName(); if (nameDef.equals("*") && (equalsMayBeNullOrZeroLen(uri, uriDef) || (uriDef != null && uriDef.equals("*") && uri!=null && uri.length() > 0 ))) else if (equalsMayBeNullOrZeroLen(uri, uriDef) && localName.equals(nameDef)) if (uri.length() > 0 && !equalsMayBeNullOrZeroLen(uri, Constants.S_XSLNAMESPACEURL))
XSLTElementDef charData = new XSLTElementDef(this, null, "text()", null /*alias */, null /* elements */, null, /* attributes */ new ProcessorCharacters(), ElemTextLiteral.class /* class object */); charData.setType(XSLTElementDef.T_PCDATA); XSLTElementDef whiteSpaceOnly = new XSLTElementDef(this, null, "text()", null /*alias */, null /* elements */, null, /* attributes */ charData.setType(XSLTElementDef.T_PCDATA); XSLTElementDef resultElement = new XSLTElementDef(this, null, "*", null /*alias */, templateElements /* elements */, ElemLiteralResult.class /* class object */, 20, true); XSLTElementDef unknownElement = new XSLTElementDef(this, "*", "unknown", null /*alias */, templateElementsAndParams /* elements */, new XSLTAttributeDef[]{ xslExcludeResultPrefixesAttr, new ProcessorUnknown(), ElemUnknown.class /* class object */, 20, true); XSLTElementDef xslValueOf = new XSLTElementDef(this, Constants.S_XSLNAMESPACEURL, "value-of", null /*alias */, null /* elements */,
/** * Receive notification of the start of an element. * * @param handler non-null reference to current StylesheetHandler that is constructing the Templates. * @param uri The Namespace URI, or an empty string. * @param localName The local name (without prefix), or empty string if not namespace processing. * @param rawName The qualified name (with prefix). * @param attributes The specified or defaulted attributes. */ public void startElement( StylesheetHandler handler, String uri, String localName, String rawName, Attributes attributes) throws org.xml.sax.SAXException { if (m_savedLastOrder == null) m_savedLastOrder = new IntStack(); m_savedLastOrder.push(getElemDef().getLastOrder()); getElemDef().setLastOrder(-1); }
XSLTElementDef charData = new XSLTElementDef(this, null, "text()", null /*alias */, null /* elements */, null, /* attributes */ new ProcessorCharacters(), ElemTextLiteral.class /* class object */); charData.setType(XSLTElementDef.T_PCDATA); XSLTElementDef whiteSpaceOnly = new XSLTElementDef(this, null, "text()", null /*alias */, null /* elements */, null, /* attributes */ charData.setType(XSLTElementDef.T_PCDATA); XSLTElementDef resultElement = new XSLTElementDef(this, null, "*", null /*alias */, templateElements /* elements */, ElemLiteralResult.class /* class object */, 20, true); XSLTElementDef unknownElement = new XSLTElementDef(this, "*", "unknown", null /*alias */, templateElementsAndParams /* elements */, new XSLTAttributeDef[]{ xslExcludeResultPrefixesAttr, new ProcessorUnknown(), ElemUnknown.class /* class object */, 20, true); XSLTElementDef xslValueOf = new XSLTElementDef(this, Constants.S_XSLNAMESPACEURL, "value-of", null /*alias */, null /* elements */,
Class classObject = def.getClassObject(); ElemTemplateElement elem = null;
/** * Tell if the namespace URI and local name match this * element. * @param uri The namespace uri, which may be null. * @param localName The local name of an element, which may be null. * * @return true if the uri and local name arguments are considered * to match the uri and local name of this element def. */ private boolean QNameEquals(String uri, String localName) { return (equalsMayBeNullOrZeroLen(m_namespace, uri) && (equalsMayBeNullOrZeroLen(m_name, localName) || equalsMayBeNullOrZeroLen(m_nameAlias, localName))); }
this.m_attributes = attributes; setElementProcessor(contentHandler); if (hasRequired() && m_elements != null) if (def != null && def.getRequired()) m_requiredFound.put(def.getName(), "xsl:" +def.getName());
XSLTElementDef charData = new XSLTElementDef(this, null, "text()", null /*alias */, null /* elements */, null, /* attributes */ new ProcessorCharacters(), ElemTextLiteral.class /* class object */); charData.setType(XSLTElementDef.T_PCDATA); XSLTElementDef whiteSpaceOnly = new XSLTElementDef(this, null, "text()", null /*alias */, null /* elements */, null, /* attributes */ charData.setType(XSLTElementDef.T_PCDATA); XSLTElementDef resultElement = new XSLTElementDef(this, null, "*", null /*alias */, templateElements /* elements */, ElemLiteralResult.class /* class object */, 20, true); XSLTElementDef unknownElement = new XSLTElementDef(this, "*", "unknown", null /*alias */, templateElementsAndParams /* elements */, new XSLTAttributeDef[]{ xslExcludeResultPrefixesAttr, new ProcessorUnknown(), ElemUnknown.class /* class object */, 20, true); XSLTElementDef xslValueOf = new XSLTElementDef(this, Constants.S_XSLNAMESPACEURL, "value-of", null /*alias */, null /* elements */,
/** * Receive notification of the start of an element. * * @param handler non-null reference to current StylesheetHandler that is constructing the Templates. * @param uri The Namespace URI, or an empty string. * @param localName The local name (without prefix), or empty string if not namespace processing. * @param rawName The qualified name (with prefix). * @param attributes The specified or defaulted attributes. */ public void startElement( StylesheetHandler handler, String uri, String localName, String rawName, Attributes attributes) throws org.xml.sax.SAXException { if (m_savedLastOrder == null) m_savedLastOrder = new IntStack(); m_savedLastOrder.push(getElemDef().getLastOrder()); getElemDef().setLastOrder(-1); }
XSLTAttributeDef[] attrDefs = getAttributes(); int nAttrDefs = attrDefs.length; String nameDef = attrDef.getName(); if (nameDef.equals("*") && (equalsMayBeNullOrZeroLen(uri, uriDef) || (uriDef != null && uriDef.equals("*") && uri!=null && uri.length() > 0 ))) else if (equalsMayBeNullOrZeroLen(uri, uriDef) && localName.equals(nameDef)) if (uri.length() > 0 && !equalsMayBeNullOrZeroLen(uri, Constants.S_XSLNAMESPACEURL))
XSLTElementDef charData = new XSLTElementDef(this, null, "text()", null /*alias */, null /* elements */, null, /* attributes */ new ProcessorCharacters(), ElemTextLiteral.class /* class object */); charData.setType(XSLTElementDef.T_PCDATA); XSLTElementDef whiteSpaceOnly = new XSLTElementDef(this, null, "text()", null /*alias */, null /* elements */, null, /* attributes */ charData.setType(XSLTElementDef.T_PCDATA); XSLTElementDef resultElement = new XSLTElementDef(this, null, "*", null /*alias */, templateElements /* elements */, ElemLiteralResult.class /* class object */, 20, true); XSLTElementDef unknownElement = new XSLTElementDef(this, "*", "unknown", null /*alias */, templateElementsAndParams /* elements */, new XSLTAttributeDef[]{ xslExcludeResultPrefixesAttr, new ProcessorUnknown(), ElemUnknown.class /* class object */, 20, true); XSLTElementDef xslValueOf = new XSLTElementDef(this, Constants.S_XSLNAMESPACEURL, "value-of", null /*alias */, null /* elements */,
Class classObject = def.getClassObject(); ElemTemplateElement elem = null;
/** * Tell if the namespace URI and local name match this * element. * @param uri The namespace uri, which may be null. * @param localName The local name of an element, which may be null. * * @return true if the uri and local name arguments are considered * to match the uri and local name of this element def. */ private boolean QNameEquals(String uri, String localName) { return (equalsMayBeNullOrZeroLen(m_namespace, uri) && (equalsMayBeNullOrZeroLen(m_name, localName) || equalsMayBeNullOrZeroLen(m_nameAlias, localName))); }
if (!equalsMayBeNullOrZeroLen(uri, Constants.S_XSLNAMESPACEURL)) order = def.getOrder(); multiAllowed = def.getMultiAllowed(); else if (def.QNameEquals(uri, localName)) if (def.getRequired()) this.setRequiredFound(def.getName(), true); order = def.getOrder(); multiAllowed = def.getMultiAllowed(); elemDef = def.m_elementProcessor; break; if (elemDef != null && this.isOrdered()) int lastOrder = getLastOrder(); if (order > lastOrder) setLastOrder(order); else if (order == lastOrder && !multiAllowed)
this.m_attributes = attributes; setElementProcessor(contentHandler); if (hasRequired() && m_elements != null) if (def != null && def.getRequired()) m_requiredFound.put(def.getName(), "xsl:" +def.getName());
XSLTElementDef charData = new XSLTElementDef(this, null, "text()", null /*alias */, null /* elements */, null, /* attributes */ new ProcessorCharacters(), ElemTextLiteral.class /* class object */); charData.setType(XSLTElementDef.T_PCDATA); XSLTElementDef whiteSpaceOnly = new XSLTElementDef(this, null, "text()", null /*alias */, null /* elements */, null, /* attributes */ charData.setType(XSLTElementDef.T_PCDATA); XSLTElementDef resultElement = new XSLTElementDef(this, null, "*", null /*alias */, templateElements /* elements */, ElemLiteralResult.class /* class object */, 20, true); XSLTElementDef unknownElement = new XSLTElementDef(this, "*", "unknown", null /*alias */, templateElementsAndParams /* elements */, new XSLTAttributeDef[]{ xslExcludeResultPrefixesAttr, new ProcessorUnknown(), ElemUnknown.class /* class object */, 20, true); XSLTElementDef xslValueOf = new XSLTElementDef(this, Constants.S_XSLNAMESPACEURL, "value-of", null /*alias */, null /* elements */,