Parse the given string into a root Node, and then renders it processing extend parents.

@param template
string to parse
@return rendered result
427705
public String render(String template) {
    ENGINE_LOG.debug(template);
    return render(parse(template), true);
  }
77827
function parseStringAttrs(templates, context) {
  var stringAttrs = '';
  var toString = new ToString(true, true);
  for (var i = 0; i < templates.length; i++) {
    toString.clear();
    render(toString, templates[i], context);
    stringAttrs += ' ' + toString.getOutput() + ' ';
  }
  if (whitespaceOnlyRegex.test(stringAttrs)) {
    return null;
  }
  var node = htmlParser('<div ' + stringAttrs + '></div>');
  return node.properties.attributes;
}
1039405
def parse_from_template(template_name):
    
    thisdir = os.path.split(__file__)[0]
    filename = os.path.join(
        thisdir, '..', 'templates', '%s.xml' % template_name
    )
    with open(filename, 'rb') as f:
        xml = f.read()
    return parse_xml(xml)
733510
private final CompiledST loadTemplateResource(String prefix, String unqualifiedFileName) {
        //if (resourceRoot == null) return null;
        //return loadTemplate(resourceRoot, prefix, unqualifiedFileName);
        if (resourceRoots.isEmpty()) return null;
        CompiledST template = null;
        for (URL resourceRoot : resourceRoots) {
            if ((template = loadTemplate(resourceRoot, prefix, unqualifiedFileName)) != null)
                return template;
        }
        return null;
    }
655243
public function getCoreRenderedTemplate( $template, $layout = NULL ) {
        return $this->render(POWERON_ROOT . DS . $template, $layout ? POWERON_ROOT . DS . $layout : NULL);
    }
829103
public Renderable<?> render(Template template, Object... parameters) {
        Map<String, Object> map = Maps.newHashMap();
        String key = null;
        for (Object parameter : parameters) {
            if (key == null) {
                if (!(parameter instanceof String)) {
                    throw new IllegalArgumentException("The template variable name " + parameter + " must be a string");
                } else {
                    key = (String) parameter;
                }
            } else {
                map.put(key, parameter);
                key = null;
            }
        }
        if (key != null) {
            throw new IllegalArgumentException("Illegal number of parameter, the variable " + key + " has no value");
        }
        return template.render(this, map);
    }
961022
function createInnerTextNode(parentNode, tokens, template) {
  var text = createHtmlText(tokens);
  var childNode = domify(template);
  childNode.innerHTML = text;
  parentNode.appendChild(childNode);
}
368754
private static String templateToHtml( Template t){
		if( t == null ) {
			return "null";
		}

		StringBuilder result = new StringBuilder();

		result.append(
			"<table class=\"Template\">\n" +
			"<tr><th class=\"Template\">Template</th></tr>\n"+
			"<tr><td class=\"Template\">" +
			"Name: \""+convertTags( t.getName() )+"\"<br>"+
			"</td></tr>\n");

		if( t.getParameters().size() != 0 ){
			result.append("<tr><td class=\"Template\">");
			for( String parameter: t.getParameters() ) {
				result.append("Parameter: \""+convertTags( parameter )+"\"<br>");
			}
			result.append("</td></tr>\n");
		}

		result.append("</table>" );

		return result.toString();
	}
1347038
protected Map<String, String> parseNamespaces(final String template)
   {
      Map<String, String> namespaces = CollectionUtils.newHashMap();
      Document document = XmlUtils.documentFromString(template);
      Element element = document.getDocumentElement();
      NamedNodeMap attributes = element.getAttributes();

      for (int loop = 0, length = attributes.getLength(); loop < length; loop++)
      {
         org.w3c.dom.Node node = attributes.item(loop);
         String nodeName = node.getNodeName();
         int indexOf = nodeName.indexOf(XMLNS_PREFIX);

         if (indexOf == -1)
         {
            continue;
         }

         namespaces.put(nodeName.substring(indexOf + XMLNS_PREFIX.length()), node.getNodeValue());
      }

      return namespaces;
   }
937538
private Template parseTemplate(Resource resource, String name, Locale locale, String encoding, Object args) throws IOException, ParseException {
        if (resource == null) {
            resource = loadResource(name, locale, encoding);
        }
        long start = logger != null && logger.isDebugEnabled() ? System.currentTimeMillis() : 0;
        String source = resource.getSource();
        try {
            if (templateFilter != null) {
                source = templateFilter.filter(resource.getName(), source);
            }
            Node root = templateParser.parse(source, 0);
            Map<String, Class<?>> parameterTypes = useRenderVariableType && args != null ? new DelegateMap<String, Class<?>>(new TypeMap(convertMap(args))) : null;
            Template template = translator.translate(resource, root, parameterTypes);
            if (logger != null && logger.isDebugEnabled()) {
                logger.debug("Parsed the template " + name + ", eslapsed: " + (System.currentTimeMillis() - start) + "ms.");
            }
            return template;
        } catch (ParseException e) {
            throw AbstractTemplate.toLocatedParseException(e, resource);
        }
    }
282484
public CompositeGeneratorNode appendTemplate(final CompositeGeneratorNode parent, final StringConcatenationClient templateString) {
    final TemplateNode proc = new TemplateNode(templateString, this);
    List<IGeneratorNode> _children = parent.getChildren();
    _children.add(proc);
    return parent;
  }
1332856
public void addExtendRelationship(TemplateClass parent, TemplateClass child) {
        if (mode().isProd()) return;
        Set<TemplateClass> children = extendMap.get(parent);
        if (null == children) {
            children = new HashSet<TemplateClass>();
            extendMap.put(parent, children);
        }
        children.add(child);
    }
20878
public Template getTemplate(String key, String parent, ResourceLoader loader)
	{
		Template template = this.getTemplate(key, loader);
		template.isRoot = false;
		return template;
	}
38713
private void parseTemplate() {
    /*
     * query string and path literals have different reserved characters and different encoding
     * requirements. to ensure compliance with RFC 6570, we'll need to encode query literals
     * differently from path literals. let's look at the template to see if it contains a query
     * string and if so, keep track of where it starts.
     */
    Matcher queryStringMatcher = QUERY_STRING_PATTERN.matcher(this.template);
    if (queryStringMatcher.find()) {
      /*
       * the template contains a query string, split the template into two parts, the path and query
       */
      String path = this.template.substring(0, queryStringMatcher.start());
      String query = this.template.substring(queryStringMatcher.end() - 1);
      this.parseFragment(path, false);
      this.parseFragment(query, true);
    } else {
      /* parse the entire template */
      this.parseFragment(this.template, false);
    }
  }
273535
def _Parse(self, template):
    

    if not template:
      raise TextFSMTemplateError('Null template.')

    # Parse header with Variables.
    self._ParseFSMVariables(template)

    # Parse States.
    while self._ParseFSMState(template):
      pass

    # Validate destination states.
    self._ValidateFSM()
507114
public Response andTemplate(String template) {
        Objects.requireNonNull(template, Required.TEMPLATE.toString());
        this.template = template;

        return this;
    }
628932
public static String render(Template template, Map<String, Object> bindingMap) {
		template.binding(bindingMap);
		return template.render();
	}