Class NQXML::Writer
In: nqxml/writer.rb
Parent: Object
Methods
attribute    cdataSection    characterReference    comment    endAttribute    endElement    entityReference    finishStartTag    indent    new    processingInstruction    startAttribute    startElement    write    writeDocument    writeNodeTree   
Attributes
:prettify  [RW] 
Public Class methods
new(io, prettify = false)
Public Instance methods
writeNodeTree(node)

Writes an entire tree structure out to @io.

writeDocument(doc)

Writes a document object out to @io. Writes each of the document's prolog entities, then the tree structure starting at the root note.

write(str)

Writes encoded version of string.

finishStartTag()

Writes the end of a start tag.

startElement(name)

Starts an element. This may be followed by zero or more calls to attribute. The start-tag will be closed by the first following call to any method other than attribute.

attribute(name, value)

Writes an attribute. This is not legal if there have been calls to methods other than attribute since the last call to startElement, unless inside a startAttribute, endAttribute pair.

startAttribute(name)

Starts an attribute. This writes the attribute name, '=' and the opening quote. This provides an alternative to attribute that allows markup to be included in the attribute value. The value of the attribute is written using the normal write methods; endAttribute must be called at the end of the attribute value. Entity and character references can be written using entityReference and characterReference.

endAttribute()

Ends an attribute. This writes the closing quote of the attribute value.

endElement(name)

Ends an element. This may output an end-tag or close the current start-tag as an empty element.

processingInstruction(target, data)

Writes a processing instruction. If data is non-empty a space will be inserted automatically to separate it from the target.

comment(body)

Writes a comment.

entityReference(isParam, name)

Writes an entity reference.

characterReference(n)

Writes a character reference. If n is a string, write the first character as an integer. Else, use n.

cdataSection(content)

Writes a CDATA section.

indent()