@Override TemplateModel calculateResult(TemplateNodeModel nodeModel, Environment env) throws TemplateModelException { String nsURI = nodeModel.getNodeNamespace(); return nsURI == null ? null : new SimpleScalar(nsURI); } }
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; } }
&& !nodeType.equals("document_type")) { throw new _MiscTemplateException( this, noNodeHandlerDefinedDescription(node, node.getNodeNamespace(), nodeType)); this, noNodeHandlerDefinedDescription(node, node.getNodeNamespace(), "default"));
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 { String nsURI = nodeModel.getNodeNamespace(); return nsURI == null ? null : new SimpleScalar(nsURI); } }
@Override TemplateModel calculateResult(TemplateNodeModel nodeModel, Environment env) throws TemplateModelException { String nsURI = nodeModel.getNodeNamespace(); return nsURI == null ? null : new SimpleScalar(nsURI); } }
@Override TemplateModel calculateResult(TemplateNodeModel nodeModel, Environment env) throws TemplateModelException { String nsURI = nodeModel.getNodeNamespace(); return nsURI == null ? null : new SimpleScalar(nsURI); } }
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; } }
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; } }
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; } }
&& !nodeType.equals("document_type")) { throw new _MiscTemplateException( this, noNodeHandlerDefinedDescription(node, node.getNodeNamespace(), nodeType)); this, noNodeHandlerDefinedDescription(node, node.getNodeNamespace(), "default"));
&& !nodeType.equals("document_type")) { throw new _MiscTemplateException( this, noNodeHandlerDefinedDescription(node, node.getNodeNamespace(), nodeType)); this, noNodeHandlerDefinedDescription(node, node.getNodeNamespace(), "default"));
String ns = node.getNodeNamespace(); if (ns != null) { if (ns.length() >0) { String ns = node.getNodeNamespace(); if (ns != null) { if (ns.length() >0) {
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 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 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; }