The OutputElement object represents an XML element. Attributes can be added to this before ant child element has been acquired from it. Once a child element has been acquired the attributes will be written an can no longer be manipulated, the same applies to any text value set for the element.
Inheritance: OutputNode
Beispiel #1
0
        /// <summary>
        /// This is used to begin writing on a new XML element. This is
        /// typically done by writing any comments required. This will
        /// create an output node of the specified name before writing
        /// the comment, if any exists. Once the comment has been written
        /// the node is pushed on to the head of the output node stack.
        /// </summary>
        /// <param name="parent">
        /// this is the parent node to the next output node
        /// </param>
        /// <param name="name">
        /// this is the name of the node that is to be created
        /// </param>
        /// <returns>
        /// this returns an output node used for writing content
        /// </returns>
        public OutputNode WriteStart(OutputNode parent, String name)
        {
            OutputNode node = new OutputElement(parent, this, name);

            if (name == null)
            {
                throw new NodeException("Can not have a null name");
            }
            return(stack.Push(node));
        }
Beispiel #2
0
  /// <summary>
  /// This is used to begin writing on a new XML element. This is
  /// typically done by writing any comments required. This will
  /// create an output node of the specified name before writing
  /// the comment, if any exists. Once the comment has been written
  /// the node is pushed on to the head of the output node stack.
  /// </summary>
  /// <param name="parent">
  /// this is the parent node to the next output node
  /// </param>
  /// <param name="name">
  /// this is the name of the node that is to be created
  /// </param>
  /// <returns>
  /// this returns an output node used for writing content
  /// </returns>
 public OutputNode WriteStart(OutputNode parent, String name) {
    OutputNode node = new OutputElement(parent, this, name);
    if(name == null) {
       throw new NodeException("Can not have a null name");
    }
    return stack.Push(node);
 }