The NodeWriter object is used to create a writer that will write well formed indented XML for a given output node. This is used in the serialization process to convert an object into an XML document.

This keeps a stack of all the active output nodes so that if an output node has been committed it cannot write any further data to the XML document. This allows all output nodes to be independent of each other as the node write organizes the write access.

Ejemplo n.º 1
0
 /// <summary>
 /// Constructor for the <c>OutputDocument</c> object. This
 /// is used to create an empty output node object that can be
 /// used to create a root element for the generated document.
 /// </summary>
 /// <param name="writer">
 /// this is the node writer to write the node to
 /// </param>
 /// <param name="stack">
 /// this is the stack that contains the open nodes
 /// </param>
 public OutputDocument(NodeWriter writer, OutputStack stack)
 {
     this.table  = new OutputNodeMap(this);
     this.mode   = Mode.INHERIT;
     this.writer = writer;
     this.stack  = stack;
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Constructor for the <c>OutputElement</c> object. This is
 /// used to create an output element that can create elements for
 /// an XML document. This requires the writer that is used to
 /// generate the actual document and the name of this node.
 /// </summary>
 /// <param name="parent">
 /// this is the parent node to this output node
 /// </param>
 /// <param name="writer">
 /// this is the writer used to generate the file
 /// </param>
 /// <param name="name">
 /// this is the name of the element this represents
 /// </param>
 public OutputElement(OutputNode parent, NodeWriter writer, String name) {
    this.scope = new PrefixResolver(parent);
    this.table = new OutputNodeMap(this);
    this.mode = Mode.INHERIT;
    this.writer = writer;
    this.parent = parent;
    this.name = name;
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Constructor for the <c>OutputElement</c> object. This is
 /// used to create an output element that can create elements for
 /// an XML document. This requires the writer that is used to
 /// generate the actual document and the name of this node.
 /// </summary>
 /// <param name="parent">
 /// this is the parent node to this output node
 /// </param>
 /// <param name="writer">
 /// this is the writer used to generate the file
 /// </param>
 /// <param name="name">
 /// this is the name of the element this represents
 /// </param>
 public OutputElement(OutputNode parent, NodeWriter writer, String name)
 {
     this.scope  = new PrefixResolver(parent);
     this.table  = new OutputNodeMap(this);
     this.mode   = Mode.Inherit;
     this.writer = writer;
     this.parent = parent;
     this.name   = name;
 }
Ejemplo n.º 4
0
 /// <summary>
 /// Constructor for the <c>OutputDocument</c> object. This
 /// is used to create an empty output node object that can be
 /// used to create a root element for the generated document.
 /// </summary>
 /// <param name="writer">
 /// this is the node writer to write the node to
 /// </param>
 /// <param name="stack">
 /// this is the stack that contains the open nodes
 /// </param>
 public OutputDocument(NodeWriter writer, OutputStack stack) {
    this.table = new OutputNodeMap(this);
    this.mode = Mode.INHERIT;
    this.writer = writer;
    this.stack = stack;
 }