Creates and returns a new node in the EPP 1.0 namespace

 @param [String] name of the node to create
 @param [String,XML::Node,nil] value of the node
 @return [XML::Node]
556674
def epp_node(name, value = nil, namespaces = {})
      value, namespaces = nil, value if value.kind_of?(Hash)

      node = xml_node(name, value)
      node.namespaces.namespace = epp_namespace(node, nil, namespaces)
      node
    end
1098819
def newCharRef(self, name):
        
        ret = libxml2mod.xmlNewCharRef(self._o, name)
        if ret is None:raise treeError('xmlNewCharRef() failed')
        __tmp = xmlNode(_obj=ret)
        return __tmp
233346
function (name) {
        var newName;
        if (gpf.xml.isValidName(name)) {
            return name;
        }
        // Try with a starting _
        newName = "_" + name;
        if (!gpf.xml.isValidName(newName)) {
            gpf.Error.xmlInvalidName();
        }
        return newName;
    }
455526
def newNsProp(self, node, name, value):
        
        if node is None: node__o = None
        else: node__o = node._o
        ret = libxml2mod.xmlNewNsProp(node__o, self._o, name, value)
        if ret is None:raise treeError('xmlNewNsProp() failed')
        __tmp = xmlAttr(_obj=ret)
        return __tmp
955509
def _do_element(self, node, initial_other_attrs = [], unused = None):
        ''''''

        # Get state (from the stack) make local copies.
        #   ns_parent -- NS declarations in parent
        #   ns_rendered -- NS nodes rendered by ancestors
        #        ns_local -- NS declarations relevant to this element
        #   xml_attrs -- Attributes in XML namespace from parent
        #       xml_attrs_local -- Local attributes in XML namespace.
        #   ns_unused_inherited -- not rendered namespaces, used for exclusive 
        ns_parent, ns_rendered, xml_attrs = \
                self.state[0], self.state[1].copy(), self.state[2].copy() #0422
                
        ns_unused_inherited = unused
        if unused is None:
            ns_unused_inherited = self.state[3].copy()
            
        ns_local = ns_parent.copy()
        inclusive = _inclusive(self)
        xml_attrs_local = {}

        # Divide attributes into NS, XML, and others.
        other_attrs = []
        in_subset = _in_subset(self.subset, node)
        for a in initial_other_attrs + _attrs(node):
            if a.namespaceURI == XMLNS.BASE:
                n = a.nodeName
                if n == "xmlns:": n = "xmlns"        # DOM bug workaround
                ns_local[n] = a.nodeValue
            elif a.namespaceURI == XMLNS.XML:
                if inclusive or (in_subset and  _in_subset(self.subset, a)): #020925 Test to see if attribute node in subset
                    xml_attrs_local[a.nodeName] = a #0426
            else:
                if  _in_subset(self.subset, a):     #020925 Test to see if attribute node in subset
                    other_attrs.append(a)
                    
#                # TODO: exclusive, might need to define xmlns:prefix here
#                if not inclusive and a.prefix is not None and not ns_rendered.has_key('xmlns:%s' %a.prefix):
#                    ns_local['xmlns:%s' %a.prefix] = ??

            #add local xml:foo attributes to ancestor's xml:foo attributes
            xml_attrs.update(xml_attrs_local)

        # Render the node
        W, name = self.write, None
        if in_subset: 
            name = node.nodeName
            if not inclusive:
                if node.prefix is not None:
                    prefix = 'xmlns:%s' %node.prefix
                else:
                    prefix = 'xmlns'
                    
                if not ns_rendered.has_key(prefix) and not ns_local.has_key(prefix):
                    if not ns_unused_inherited.has_key(prefix):
                        raise RuntimeError,\
                            'For exclusive c14n, unable to map prefix "%s" in %s' %(
                            prefix, node)
                    
                    ns_local[prefix] = ns_unused_inherited[prefix]
                    del ns_unused_inherited[prefix]
                
            W('<')
            W(name)

            # Create list of NS attributes to render.
            ns_to_render = []
            for n,v in ns_local.items():

                # If default namespace is XMLNS.BASE or empty,
                # and if an ancestor was the same
                if n == "xmlns" and v in [ XMLNS.BASE, '' ] \
                and ns_rendered.get('xmlns') in [ XMLNS.BASE, '', None ]:
                    continue

                # "omit namespace node with local name xml, which defines
                # the xml prefix, if its string value is
                # http://www.w3.org/XML/1998/namespace."
                if n in ["xmlns:xml", "xml"] \
                and v in [ 'http://www.w3.org/XML/1998/namespace' ]:
                    continue


                # If not previously rendered
                # and it's inclusive  or utilized
                if (n,v) not in ns_rendered.items():
                    if inclusive or _utilized(n, node, other_attrs, self.unsuppressedPrefixes):
                        ns_to_render.append((n, v))
                    elif not inclusive:
                        ns_unused_inherited[n] = v

            # Sort and render the ns, marking what was rendered.
            ns_to_render.sort(_sorter_ns)
            for n,v in ns_to_render:
                self._do_attr(n, v)
                ns_rendered[n]=v    #0417

            # If exclusive or the parent is in the subset, add the local xml attributes
            # Else, add all local and ancestor xml attributes
            # Sort and render the attributes.
            if not inclusive or _in_subset(self.subset,node.parentNode):  #0426
                other_attrs.extend(xml_attrs_local.values())
            else:
                other_attrs.extend(xml_attrs.values())
            other_attrs.sort(_sorter)
            for a in other_attrs:
                self._do_attr(a.nodeName, a.value)
            W('>')

        # Push state, recurse, pop state.
        state, self.state = self.state, (ns_local, ns_rendered, xml_attrs, ns_unused_inherited)
        for c in _children(node):
            _implementation.handlers[c.nodeType](self, c)
        self.state = state

        if name: W('</%s>' % name)
295855
def newProp(self, name, value):
        
        ret = libxml2mod.xmlNewProp(self._o, name, value)
        if ret is None:raise treeError('xmlNewProp() failed')
        __tmp = xmlAttr(_obj=ret)
        return __tmp
362526
def node(name, type, options = {}, &block)
      attr_reader name.to_sym
      options[:local_context] = @local_context
      xpath = NodeXPath.new(name, options).xpath
      define_method("parse_#{name}".to_sym) do
        evaluate_args = [xpath, AwesomeXML::Type.for(type, self.class.name), options]
        instance_variable_set(
          "@#{name}",
          evaluate_nodes(*evaluate_args, &block)
        )
      end
      register(name, options[:private])
    end
1339376
def make_node(cls, *args):
        
        new_args = []

        args = [x for x in args if not is_null(x)]
        for x in args:
            assert isinstance(x, Symbol)
            if x.token == 'BLOCK':
                new_args.extend(SymbolBLOCK.make_node(*x.children).children)
            else:
                new_args.append(x)

        result = SymbolBLOCK(*new_args)
        return result
982067
def desc=(value)
      node = at './desc'
      node ||= add_child Nokogiri::XML::Node.new('desc', document)

      node.content = value
    end
1020736
def from_xml_string(xml, element_name = default_element_name)
        xml_doc = Nokogiri::XML(xml)
        from_xml_doc(xml_doc.at_xpath("./#{element_name}"))
      end
1055296
def attribute_value_object(name)
  
      #Ensure we have a string- this allows us to use symbols as attribute names, as well.
      #This is more idiomatic.
      name = name.to_s

      #Get the node that corresponds to the given attribute, if it exists.
      node = @xml.at_css("symbol attr[name=\"#{name}\"]")

      #If the node exists, return its value; otherwise, return nil.
      return node ? node.attribute('value') : nil

    end
1067017
def create_getter(name, value)
      instance_variable_set(:"@#{name}", value)
      create_method(name.to_sym) do
        instance_variable_get(:"@#{name}")
      end
    end
280524
public AstNode node( String name ) {
        CheckArg.isNotNull(name, "name");
        AstNode node = new AstNode(name);
        node.setProperty(JCR_PRIMARY_TYPE, NT_UNSTRUCTURED);
        return node;
    }
1272891
def createNode(self, cls, name, *args, **kw):
        
        m = self.findNode(name)
        if m is None:
            m = cls(name, *args, **kw)
            self.addNode(m)
        return m
434310
def new_cxnSp(cls, id_, name, prst, x, y, cx, cy, flipH, flipV):
        
        tmpl = cls._cxnSp_tmpl()
        flip = (
            (' flipH="1"' if flipH else '') + (' flipV="1"' if flipV else '')
        )
        xml = tmpl.format(**{
            'nsdecls': nsdecls('a', 'p'),
            'id':      id_,
            'name':    name,
            'x':       x,
            'y':       y,
            'cx':      cx,
            'cy':      cy,
            'prst':    prst,
            'flip':    flip,
        })
        return parse_xml(xml)
926160
def find_node(results, node_name)
      document = ::Nokogiri::XML(results.body)
      document.remove_namespaces!
      document.xpath("//#{node_name}").first
    end
897063
def root *args, &block
      return @root if args.empty?
      node = args[0]
      @asks_allow_children = args[1]
      if !node.is_a? TreeNode
        n = TreeNode.new node
        node = n
      end
      @root = node
      $log.debug " XXX def root created root with #{node} "
      #add node, true, &block 
      instance_eval &block if block_given?
    end