Reference Guide > X–Z Routines > XmlNewNode Function
  

XmlNewNode Function
Creates a new XML Node.
Usage
node_id = XmlNewNode(node_name)
Input Parameters
node_name—A string containing the name of the XML node.
Returned Value
node_id—A new XML node id.
Keywords
Content—A string specifying the content for the new node.
Href—A string specifying the namespace value for the new node.
Prefix—A string specifying the namespace prefix for the new node
Discussion
XmlNewNode is used to create a new XML node. You can specify the content of the node as an optional argument as well as the namespace information. Attributes for this node can be added with XmlSetAttribute. The node must be added to an XML document with XmlAddNode.
Example 1
This example creates a new XML node with an empty content.
; Create a ChartTitle node.
node_id = XmlNewNode('ChartTitle')
Example 2
This example creates a new XML node with content.
; Add text to this node.
node_id = XmlNewNode('ChartTitle', Content='Rogue Wave')
Example 3
This example creates a node with a namespace. A namespace in an XML file allows you to separate your element or node names from other XML
Element or node names. It makes your XML node unique. It is useful when parsing a well-formed XML document without a DTD.
node_id = XmlNewNode('ChartTitle', $
   Prefix='pvwave', Href='http://www.roguewave.com')

Version 2017.0
Copyright © 2017, Rogue Wave Software, Inc. All Rights Reserved.