@Override TemplateModel calculateResult(TemplateNodeModel nodeModel, Environment env) throws TemplateModelException { return new SimpleScalar(nodeModel.getNodeName()); } }
TemplateModel getNodeProcessor(TemplateNodeModel node) throws TemplateException { String nodeName = node.getNodeName(); if (nodeName == null) { throw new _MiscTemplateException(this, "Node name is null."); } TemplateModel result = getNodeProcessor(nodeName, node.getNodeNamespace(), 0); if (result == null) { String type = node.getNodeType(); /* DD: Original version: */ if (type == null) { type = "default"; } result = getNodeProcessor("@" + type, null, 0); /* * DD: Jonathan's non-BC version and IMHO otherwise wrong version: if (type != null) { result = * getNodeProcessor("@" + type, null, 0); } if (result == null) { result = getNodeProcessor("@default", * null, 0); } */ } return result; }
public Object exec(List names) throws TemplateModelException { if (names == null || names.isEmpty()) { return this; } AncestorSequence result = new AncestorSequence(env); for (int i = 0; i < size(); i++) { TemplateNodeModel tnm = (TemplateNodeModel) get(i); String nodeName = tnm.getNodeName(); String nsURI = tnm.getNodeNamespace(); if (nsURI == null) { if (names.contains(nodeName)) { result.add(tnm); } } else { for (int j = 0; j < names.size(); j++) { if (_ExtDomApi.matchesName((String) names.get(j), nodeName, nsURI, env)) { result.add(tnm); break; } } } } return result; } }
private Object[] noNodeHandlerDefinedDescription( TemplateNodeModel node, String ns, String nodeType) throws TemplateModelException { String nsPrefix; if (ns != null) { if (ns.length() > 0) { nsPrefix = " and namespace "; } else { nsPrefix = " and no namespace"; } } else { nsPrefix = ""; ns = ""; } return new Object[] { "No macro or directive is defined for node named ", new _DelayedJQuote(node.getNodeName()), nsPrefix, ns, ", and there is no fallback handler called @", nodeType, " either." }; }
TemplateModel getNodeProcessor(TemplateNodeModel node) throws TemplateException { String nodeName = node.getNodeName(); if (nodeName == null) { throw new _MiscTemplateException(this, "Node name is null."); } TemplateModel result = getNodeProcessor(nodeName, node.getNodeNamespace(), 0); if (result == null) { String type = node.getNodeType(); /* DD: Original version: */ if (type == null) { type = "default"; } result = getNodeProcessor("@" + type, null, 0); /* * DD: Jonathan's non-BC version and IMHO otherwise wrong version: if (type != null) { result = * getNodeProcessor("@" + type, null, 0); } if (result == null) { result = getNodeProcessor("@default", * null, 0); } */ } return result; }
TemplateModel calculateResult(TemplateNodeModel nodeModel, Environment env) throws TemplateModelException { return new SimpleScalar(nodeModel.getNodeName()); } }
TemplateModel getNodeProcessor(TemplateNodeModel node) throws TemplateException { String nodeName = node.getNodeName(); if (nodeName == null) { throw new _MiscTemplateException(this, "Node name is null."); } TemplateModel result = getNodeProcessor(nodeName, node.getNodeNamespace(), 0); if (result == null) { String type = node.getNodeType(); /* DD: Original version: */ if (type == null) { type = "default"; } result = getNodeProcessor("@" + type, null, 0); /* * DD: Jonathan's non-BC version and IMHO otherwise wrong version: if (type != null) { result = * getNodeProcessor("@" + type, null, 0); } if (result == null) { result = getNodeProcessor("@default", * null, 0); } */ } return result; }
@Override TemplateModel calculateResult(TemplateNodeModel nodeModel, Environment env) throws TemplateModelException { return new SimpleScalar(nodeModel.getNodeName()); } }
public Object exec(List names) throws TemplateModelException { if (names == null || names.isEmpty()) { return this; } AncestorSequence result = new AncestorSequence(env); for (int i=0; i<size(); i++) { TemplateNodeModel tnm = (TemplateNodeModel) get(i); String nodeName = tnm.getNodeName(); String nsURI = tnm.getNodeNamespace(); if (nsURI == null) { if (names.contains(nodeName)) { result.add(tnm); } } else { for (int j = 0; j<names.size(); j++) { if (StringUtil.matchesName((String) names.get(j), nodeName, nsURI, env)) { result.add(tnm); break; } } } } return result; } }
@Override TemplateModel calculateResult(TemplateNodeModel nodeModel, Environment env) throws TemplateModelException { return new SimpleScalar(nodeModel.getNodeName()); } }
TemplateModel getNodeProcessor(TemplateNodeModel node) throws TemplateException { String nodeName = node.getNodeName(); if (nodeName == null) { throw new TemplateException("Node name is null.", this); } TemplateModel result = getNodeProcessor(nodeName, node.getNodeNamespace(), 0); if (result == null) { String type = node.getNodeType(); /* DD: Original version: */ if (type == null) { type = "default"; } result = getNodeProcessor("@" + type, null, 0); /* DD: Jonathan's non-BC version and IMHO otherwise wrong version: if (type != null) { result = getNodeProcessor("@" + type, null, 0); } if (result == null) { result = getNodeProcessor("@default", null, 0); } */ } return result; }
private Object[] noNodeHandlerDefinedDescription( TemplateNodeModel node, String ns, String nodeType) throws TemplateModelException { String nsPrefix; if (ns != null) { if (ns.length() > 0) { nsPrefix = " and namespace "; } else { nsPrefix = " and no namespace"; } } else { nsPrefix = ""; ns = ""; } return new Object[] { "No macro or directive is defined for node named ", new _DelayedJQuote(node.getNodeName()), nsPrefix, ns, ", and there is no fallback handler called @", nodeType, " either." }; }
public Object exec(List names) throws TemplateModelException { if (names == null || names.isEmpty()) { return this; } AncestorSequence result = new AncestorSequence(env); for (int i = 0; i < size(); i++) { TemplateNodeModel tnm = (TemplateNodeModel) get(i); String nodeName = tnm.getNodeName(); String nsURI = tnm.getNodeNamespace(); if (nsURI == null) { if (names.contains(nodeName)) { result.add(tnm); } } else { for (int j = 0; j < names.size(); j++) { if (_ExtDomApi.matchesName((String) names.get(j), nodeName, nsURI, env)) { result.add(tnm); break; } } } } return result; } }
private Object[] noNodeHandlerDefinedDescription( TemplateNodeModel node, String ns, String nodeType) throws TemplateModelException { String nsPrefix; if (ns != null) { if (ns.length() > 0) { nsPrefix = " and namespace "; } else { nsPrefix = " and no namespace"; } } else { nsPrefix = ""; ns = ""; } return new Object[] { "No macro or directive is defined for node named ", new _DelayedJQuote(node.getNodeName()), nsPrefix, ns, ", and there is no fallback handler called @", nodeType, " either." }; }
public Object exec(List names) throws TemplateModelException { if (names == null || names.isEmpty()) { return this; } AncestorSequence result = new AncestorSequence(env); for (int i = 0; i < size(); i++) { TemplateNodeModel tnm = (TemplateNodeModel) get(i); String nodeName = tnm.getNodeName(); String nsURI = tnm.getNodeNamespace(); if (nsURI == null) { if (names.contains(nodeName)) { result.add(tnm); } } else { for (int j = 0; j < names.size(); j++) { if (_ExtDomApi.matchesName((String) names.get(j), nodeName, nsURI, env)) { result.add(tnm); break; } } } } return result; } }
+ node.getNodeName() + nsBit + ", and there is no fallback handler called @" + nodeType + " either.", this); + node.getNodeName() + nsBit + ", and there is no macro or transform called @default either.", this);