Jaml-all.js
function(tagName) {
    return function(attrs) {
      var node = new Jaml.Node(tagName);

      var firstArgIsAttributes =  (typeof attrs == 'object')
                               && !(attrs instanceof Jaml.Node)
                               && !(attrs instanceof Jaml.TextNode);

      if (firstArgIsAttributes) node.setAttributes(attrs);

      var startIndex = firstArgIsAttributes ? 1 : 0;

      for (var i=startIndex; i < arguments.length; i++) {
        var arg = arguments[i];

        if (typeof arg == "string" || arg == undefined) {
          arg = new Jaml.TextNode(arg || "");
        }

        if (arg instanceof Jaml.Node || arg instanceof Jaml.TextNode) {
          arg.parent = node;
        }

        node.addChild(arg);
      };

      this.nodes.push(node);

      return node;
    };
  }
function(tagName) {
    return function(attrs) {
      var node = new Jaml.Node(tagName);

      var firstArgIsAttributes =  (typeof attrs == 'object')
                               && !(attrs instanceof Jaml.Node)
                               && !(attrs instanceof Jaml.TextNode);

      if (firstArgIsAttributes) node.setAttributes(attrs);

      var startIndex = firstArgIsAttributes ? 1 : 0;

      for (var i=startIndex; i < arguments.length; i++) {
        var arg = arguments[i];

        if (typeof arg == "string" || arg == undefined) {
          arg = new Jaml.TextNode(arg || "");
        }

        if (arg instanceof Jaml.Node || arg instanceof Jaml.TextNode) {
          arg.parent = node;
        }

        node.addChild(arg);
      };

      this.nodes.push(node);

      return node;
    };
  }
function ( tagName ) { return function ( attrs ) { var node = new Jaml . Node ( tagName ) ; var firstArgIsAttributes = ( typeof attrs == 'object' ) && ! ( attrs instanceof Jaml . Node ) && ! ( attrs instanceof Jaml . TextNode ) ; if ( firstArgIsAttributes ) node . setAttributes ( attrs ) ; var startIndex = firstArgIsAttributes ? 1 : 0 ; for ( var i = startIndex ; i < arguments . length ; i ++ ) { var arg = arguments [ i ] ; if ( typeof arg == "string" || arg == undefined ) { arg = new Jaml . TextNode ( arg || "" ) ; } if ( arg instanceof Jaml . Node || arg instanceof Jaml . TextNode ) { arg . parent = node ; } node . addChild ( arg ) ; } ; this . nodes . push ( node ) ; return node ; } ; }
This function is created for each tag name and assigned to Template's
prototype below
This function is created for each tag name and assigned to Template s prototype below