(Environment env)
| 69 | } |
| 70 | |
| 71 | void accept(Environment env) throws IOException, TemplateException { |
| 72 | TemplateModel node = targetNode == null ? null : targetNode.getAsTemplateModel(env); |
| 73 | TemplateModel nss = namespaces == null ? null : namespaces.getAsTemplateModel(env); |
| 74 | if (namespaces instanceof StringLiteral) { |
| 75 | nss = env.importLib(((TemplateScalarModel) nss).getAsString(), null); |
| 76 | } |
| 77 | else if (namespaces instanceof ListLiteral) { |
| 78 | nss = ((ListLiteral) namespaces).evaluateStringsToNamespaces(env); |
| 79 | } |
| 80 | if (node != null && !(node instanceof TemplateNodeModel)) { |
| 81 | throw new TemplateException("Expecting an XML node here, for expression: " + targetNode + ", found a: " + node.getClass().getName(), env); |
| 82 | } |
| 83 | if (nss != null) { |
| 84 | if (nss instanceof TemplateHashModel) { |
| 85 | SimpleSequence ss = new SimpleSequence(1); |
| 86 | ss.add(nss); |
| 87 | nss = ss; |
| 88 | } |
| 89 | else if (!(nss instanceof TemplateSequenceModel)) { |
| 90 | throw new TemplateException("Expecting a sequence of namespaces after 'using'", env); |
| 91 | } |
| 92 | } |
| 93 | |
| 94 | env.recurse((TemplateNodeModel) node, (TemplateSequenceModel) nss); |
| 95 | } |
| 96 | |
| 97 | public String getCanonicalForm() { |
| 98 | String result = "<#recurse"; |
nothing calls this directly
no test coverage detected