public TemplateModel get(String key) throws TemplateModelException { if (key.startsWith("@@")) { if (key.equals(AtAtKey.TEXT.getKey())) { return new SimpleScalar(getText(node)); } else if (key.equals(AtAtKey.NAMESPACE.getKey())) { String nsURI = node.getNamespaceURI(); return nsURI == null ? null : new SimpleScalar(nsURI); } else if (key.equals(AtAtKey.LOCAL_NAME.getKey())) { String localName = node.getLocalName(); if (localName == null) { } else if (key.equals(AtAtKey.MARKUP.getKey())) { StringBuilder buf = new StringBuilder(); NodeOutputter nu = new NodeOutputter(node); nu.outputContent(node, buf); return new SimpleScalar(buf.toString()); } else if (key.equals(AtAtKey.NESTED_MARKUP.getKey())) { StringBuilder buf = new StringBuilder(); NodeOutputter nu = new NodeOutputter(node); nu.outputContent(node.getChildNodes(), buf); return new SimpleScalar(buf.toString()); } else if (key.equals(AtAtKey.QNAME.getKey())) { String qname = getQualifiedName(); return qname != null ? new SimpleScalar(qname) : null; } else { if (AtAtKey.containsKey(key)) { throw new TemplateModelException( "\"" + key + "\" is not supported for an XML node of type \"" + getNodeType() + "\".");
} else if (key.startsWith("@")) { if (key.startsWith("@@")) { if (key.equals(AtAtKey.ATTRIBUTES.getKey())) { return new NodeListModel(node.getAttributes(), this); } else if (key.equals(AtAtKey.START_TAG.getKey())) { NodeOutputter nodeOutputter = new NodeOutputter(node); return new SimpleScalar(nodeOutputter.getOpeningTag((Element) node)); } else if (key.equals(AtAtKey.END_TAG.getKey())) { NodeOutputter nodeOutputter = new NodeOutputter(node); return new SimpleScalar(nodeOutputter.getClosingTag((Element) node)); } else if (key.equals(AtAtKey.ATTRIBUTES_MARKUP.getKey())) { StringBuilder buf = new StringBuilder(); NodeOutputter nu = new NodeOutputter(node); nu.outputContent(node.getAttributes(), buf); return new SimpleScalar(buf.toString().trim()); } else if (key.equals(AtAtKey.PREVIOUS_SIBLING_ELEMENT.getKey())) { Node previousSibling = node.getPreviousSibling(); while (previousSibling != null && !this.isSignificantNode(previousSibling)) { } else if (key.equals(AtAtKey.NEXT_SIBLING_ELEMENT.getKey())) { Node nextSibling = node.getNextSibling(); while (nextSibling != null && !this.isSignificantNode(nextSibling)) {
} else if (key.startsWith("@")) { if (key.startsWith("@@")) { if (key.equals(AtAtKey.ATTRIBUTES.getKey())) { return new NodeListModel(node.getAttributes(), this); } else if (key.equals(AtAtKey.START_TAG.getKey())) { NodeOutputter nodeOutputter = new NodeOutputter(node); return new SimpleScalar(nodeOutputter.getOpeningTag((Element) node)); } else if (key.equals(AtAtKey.END_TAG.getKey())) { NodeOutputter nodeOutputter = new NodeOutputter(node); return new SimpleScalar(nodeOutputter.getClosingTag((Element) node)); } else if (key.equals(AtAtKey.ATTRIBUTES_MARKUP.getKey())) { StringBuilder buf = new StringBuilder(); NodeOutputter nu = new NodeOutputter(node); nu.outputContent(node.getAttributes(), buf); return new SimpleScalar(buf.toString().trim()); } else if (key.equals(AtAtKey.PREVIOUS_SIBLING_ELEMENT.getKey())) { Node previousSibling = node.getPreviousSibling(); while (previousSibling != null && !this.isSignificantNode(previousSibling)) { } else if (key.equals(AtAtKey.NEXT_SIBLING_ELEMENT.getKey())) { Node nextSibling = node.getNextSibling(); while (nextSibling != null && !this.isSignificantNode(nextSibling)) {
if (key.equals(AtAtKey.MARKUP.getKey()) || key.equals(AtAtKey.NESTED_MARKUP.getKey()) || key.equals(AtAtKey.TEXT.getKey())) { StringBuilder result = new StringBuilder(); for (int i = 0; i < size; i++) { } else if (key.length() != 2 /* to allow "@@" to fall through */) { if (AtAtKey.containsKey(key)) { throw new TemplateModelException( "\"" + key + "\" is only applicable to a single XML node, but it was applied on "
} else if (key.startsWith("@")) { if (key.startsWith("@@")) { if (key.equals(AtAtKey.ATTRIBUTES.getKey())) { return new NodeListModel(node.getAttributes(), this); } else if (key.equals(AtAtKey.START_TAG.getKey())) { NodeOutputter nodeOutputter = new NodeOutputter(node); return new SimpleScalar(nodeOutputter.getOpeningTag((Element) node)); } else if (key.equals(AtAtKey.END_TAG.getKey())) { NodeOutputter nodeOutputter = new NodeOutputter(node); return new SimpleScalar(nodeOutputter.getClosingTag((Element) node)); } else if (key.equals(AtAtKey.ATTRIBUTES_MARKUP.getKey())) { StringBuilder buf = new StringBuilder(); NodeOutputter nu = new NodeOutputter(node); nu.outputContent(node.getAttributes(), buf); return new SimpleScalar(buf.toString().trim()); } else if (key.equals(AtAtKey.PREVIOUS_SIBLING_ELEMENT.getKey())) { Node previousSibling = node.getPreviousSibling(); while (previousSibling != null && !this.isSignificantNode(previousSibling)) { } else if (key.equals(AtAtKey.NEXT_SIBLING_ELEMENT.getKey())) { Node nextSibling = node.getNextSibling(); while (nextSibling != null && !this.isSignificantNode(nextSibling)) {
public TemplateModel get(String key) throws TemplateModelException { if (key.startsWith("@@")) { if (key.equals(AtAtKey.TEXT.getKey())) { return new SimpleScalar(getText(node)); } else if (key.equals(AtAtKey.NAMESPACE.getKey())) { String nsURI = node.getNamespaceURI(); return nsURI == null ? null : new SimpleScalar(nsURI); } else if (key.equals(AtAtKey.LOCAL_NAME.getKey())) { String localName = node.getLocalName(); if (localName == null) { } else if (key.equals(AtAtKey.MARKUP.getKey())) { StringBuilder buf = new StringBuilder(); NodeOutputter nu = new NodeOutputter(node); nu.outputContent(node, buf); return new SimpleScalar(buf.toString()); } else if (key.equals(AtAtKey.NESTED_MARKUP.getKey())) { StringBuilder buf = new StringBuilder(); NodeOutputter nu = new NodeOutputter(node); nu.outputContent(node.getChildNodes(), buf); return new SimpleScalar(buf.toString()); } else if (key.equals(AtAtKey.QNAME.getKey())) { String qname = getQualifiedName(); return qname != null ? new SimpleScalar(qname) : null; } else { if (AtAtKey.containsKey(key)) { throw new TemplateModelException( "\"" + key + "\" is not supported for an XML node of type \"" + getNodeType() + "\".");
public TemplateModel get(String key) throws TemplateModelException { if (key.startsWith("@@")) { if (key.equals(AtAtKey.TEXT.getKey())) { return new SimpleScalar(getText(node)); } else if (key.equals(AtAtKey.NAMESPACE.getKey())) { String nsURI = node.getNamespaceURI(); return nsURI == null ? null : new SimpleScalar(nsURI); } else if (key.equals(AtAtKey.LOCAL_NAME.getKey())) { String localName = node.getLocalName(); if (localName == null) { } else if (key.equals(AtAtKey.MARKUP.getKey())) { StringBuilder buf = new StringBuilder(); NodeOutputter nu = new NodeOutputter(node); nu.outputContent(node, buf); return new SimpleScalar(buf.toString()); } else if (key.equals(AtAtKey.NESTED_MARKUP.getKey())) { StringBuilder buf = new StringBuilder(); NodeOutputter nu = new NodeOutputter(node); nu.outputContent(node.getChildNodes(), buf); return new SimpleScalar(buf.toString()); } else if (key.equals(AtAtKey.QNAME.getKey())) { String qname = getQualifiedName(); return qname != null ? new SimpleScalar(qname) : null; } else { if (AtAtKey.containsKey(key)) { throw new TemplateModelException( "\"" + key + "\" is not supported for an XML node of type \"" + getNodeType() + "\".");
if (key.equals(AtAtKey.MARKUP.getKey()) || key.equals(AtAtKey.NESTED_MARKUP.getKey()) || key.equals(AtAtKey.TEXT.getKey())) { StringBuilder result = new StringBuilder(); for (int i = 0; i < size; i++) { } else if (key.length() != 2 /* to allow "@@" to fall through */) { if (AtAtKey.containsKey(key)) { throw new TemplateModelException( "\"" + key + "\" is only applicable to a single XML node, but it was applied on "
if (key.equals(AtAtKey.MARKUP.getKey()) || key.equals(AtAtKey.NESTED_MARKUP.getKey()) || key.equals(AtAtKey.TEXT.getKey())) { StringBuilder result = new StringBuilder(); for (int i = 0; i < size; i++) { } else if (key.length() != 2 /* to allow "@@" to fall through */) { if (AtAtKey.containsKey(key)) { throw new TemplateModelException( "\"" + key + "\" is only applicable to a single XML node, but it was applied on "