Class: Writer

Writer


new Writer()

XML writer

Since:
  • 0.2.7
Implements:

Extends

Methods


<protected> _appendToReadBuffer(data)

Adds data to the read buffer

Parameters:
Name Type Argument Description
data * <repeatable>

Data to write

Since:
  • 0.2.3
Inherited From:
Returns:
Self reference to allow chaining
Type
gpf.xml.Writer

<protected> _completeReadBuffer()

Ends the read without any error

Since:
  • 0.2.3
Inherited From:

<protected> _setReadError(reason)

Ends the read with an error

Parameters:
Name Type Description
reason *

Rejection reason

Since:
  • 0.2.3
Inherited From:

characters(buffer)

Signal character data

Parameters:
Name Type Description
buffer String

characters

Since:
  • 0.2.7
Implements:

endDocument()

Signal the end of the document

Since:
  • 0.2.7
Implements:
Returns:

Resolved when ready

Type
Promise

endElement()

Signal the end of an element

Since:
  • 0.2.7
Implements:
Returns:

Resolved when ready

Type
Promise

endPrefixMapping(prefix)

Signal the scope end of a prefix-URI namespace mapping

Parameters:
Name Type Description
prefix String

Prefix of the prefix-URI mapping

Since:
  • 0.2.7
Implements:
Returns:

Resolved when ready

Type
Promise

processingInstruction(target, data)

Signal a processing instruction

Parameters:
Name Type Description
target String

Target of processing instruction

data String

Data of processing instruction

Since:
  • 0.2.7
Implements:
Returns:

Resolved when ready

Type
Promise

read(output)

Read all data from the underlying source. Chunk of data is passed to the gpf.interfaces.IWritableStream.

Parameters:
Name Type Description
output gpf.interfaces.IWritableStream

Stream that receives chunk of data

Since:
  • 0.2.3
Inherited From:
Implements:
Returns:

Resolved when the stream has ended

Type
Promise

startDocument()

Signal the beginning of the document

Since:
  • 0.2.7
Implements:
Returns:

Resolved when ready

Type
Promise

startElement(qName [, attributes])

Signal the beginning of an element

Parameters:
Name Type Argument Default Description
qName String

Qualified name, [prefix:]localName

attributes Object <optional>
{}

attribute dictionary (string/string)

Since:
  • 0.2.7
Implements:
Returns:

Resolved when ready

Type
Promise

startPrefixMapping(prefix, uri)

Signal the scope start a prefix-URI namespace mapping

Parameters:
Name Type Description
prefix String

Prefix of the prefix-URI mapping

uri String

Namespace URI associated with the prefix

Since:
  • 0.2.7
Implements:
Returns:

Resolved when ready

Type
Promise