Packagecom.yworks.io.graphml.writer
Classpublic class DefaultXmlWriter
InheritanceDefaultXmlWriter Inheritance Object
Implements IXmlWriter

Simple default implementation of the IXmlWriter interface.



Public Properties
 PropertyDefined By
  document : XML
[read-only] The XML to be written to.
DefaultXmlWriter
Public Methods
 MethodDefined By
  
Creates a new Instance.
DefaultXmlWriter
  
addNamespace(ns:Namespace):void
Add a namespace declaration to the root element of the output.
DefaultXmlWriter
  
appendChild(xml:XML):void
Append an xml element to the current element.
DefaultXmlWriter
  
lookup(type:Class):Object
DefaultXmlWriter
  
writeAttribute(localName:String, value:*, ns:Namespace = null):IXmlWriter
Write a Xml attribute node.
DefaultXmlWriter
  
writeComment(comment:String):IXmlWriter
Write a Xml comment node
DefaultXmlWriter
  
Close the output.
DefaultXmlWriter
  
Close a XML element previously opened with writeStartElement.
DefaultXmlWriter
  
DefaultXmlWriter
  
writeProcessingInstruction(target:String, pi:String):IXmlWriter
Write a Xml processing instruction
DefaultXmlWriter
  
writeStartDocument(docTag:String, ns:Namespace = null):IXmlWriter
Begin the output process
DefaultXmlWriter
  
writeStartElement(localName:String, ns:Namespace = null):IXmlWriter
DefaultXmlWriter
  
Writes the string and wraps it in a CDATA section, if necessary.
DefaultXmlWriter
Property Detail
documentproperty
document:XML  [read-only]

The XML to be written to.


Implementation
    public function get document():XML
Constructor Detail
DefaultXmlWriter()Constructor
public function DefaultXmlWriter()

Creates a new Instance.

Method Detail
addNamespace()method
public function addNamespace(ns:Namespace):void

Add a namespace declaration to the root element of the output.

Parameters

ns:Namespace — the namespace to be added.

appendChild()method 
public function appendChild(xml:XML):void

Append an xml element to the current element.

Parameters

xml:XML — The xml element to be added.

lookup()method 
public function lookup(type:Class):Object

Parameters

type:Class

Returns
Object
writeAttribute()method 
public function writeAttribute(localName:String, value:*, ns:Namespace = null):IXmlWriter

Write a Xml attribute node.

The attribute is attached to the closest open Xml element that has been started with writeStartElement

If the prefix and/or namespace arguments are null, no namespace and prefix is used.

Parameters

localName:String — The local name of the attribute
 
value:* — The value of this attribute
 
ns:Namespace (default = null) — The namespace of the attribute

Returns
IXmlWriter — The writer instance, to allow for output chaining
writeComment()method 
public function writeComment(comment:String):IXmlWriter

Write a Xml comment node

Parameters

comment:String — The content of the comment

Returns
IXmlWriter — the writer instance, to allow for output chaining
writeEndDocument()method 
public function writeEndDocument():IXmlWriter

Close the output.

Attemps to write to the same document after this method has been called will have undefined results

Returns
IXmlWriter — the writer instance, to allow for output chaining
writeEndElement()method 
public function writeEndElement():IXmlWriter

Close a XML element previously opened with writeStartElement.

Returns
IXmlWriter — The writer instance, to allow for output chaining.
writePlainText()method 
public function writePlainText(s:String):IXmlWriter

Parameters

s:String

Returns
IXmlWriter
writeProcessingInstruction()method 
public function writeProcessingInstruction(target:String, pi:String):IXmlWriter

Write a Xml processing instruction

Parameters

target:String — the target of the processing instruction (e.g. "xml-stylesheet" in <?xml-stylesheet ..>)
 
pi:String — the processing instruction data

Returns
IXmlWriter — the writer instance, to allow for output chaining
writeStartDocument()method 
public function writeStartDocument(docTag:String, ns:Namespace = null):IXmlWriter

Begin the output process

Parameters

docTag:String
 
ns:Namespace (default = null) — the document namespace or null

Returns
IXmlWriter — the writer instance, to allow for output chaining
writeStartElement()method 
public function writeStartElement(localName:String, ns:Namespace = null):IXmlWriter

Parameters

localName:String
 
ns:Namespace (default = null)

Returns
IXmlWriter
writeText()method 
public function writeText(s:String):IXmlWriter

Writes the string and wraps it in a CDATA section, if necessary. Write a text node.

Parameters

s:String — The content of the text node

Returns
IXmlWriter — The writer instance, to allow for output chaining