Receives XML serialization event and writes to {@link XmlOutput}.
This object coordinates the overall marshalling efforts across different content-tree objects and different target formats.
The following CFG gives the proper sequence of method invocation.
MARSHALLING := ELEMENT ELEMENT := "startElement" NSDECL* "endNamespaceDecls" ATTRIBUTE* "endAttributes" BODY "endElement" NSDECL := "declareNamespace" ATTRIBUTE := "attribute" ATTVALUES := "text" BODY := ( "text" | ELEMENT )
A marshalling of one element consists of two stages. The first stage is for marshalling attributes and collecting namespace declarations. The second stage is for marshalling characters/child elements of that element.
Observe that multiple invocation of "text" is allowed.
Also observe that the namespace declarations are allowed only between "startElement" and "endAttributes".
Exceptions in marshaller
{@link IOException}, {@link SAXException}, and {@link XMLStreamException}are thrown from {@link XmlOutput}. They are always considered fatal, and therefore caught only by {@link MarshallerImpl}.
{@link AccessorException} can be thrown when an access to a property/fieldfails, and this is considered as a recoverable error, so it's caught everywhere.
@author Kohsuke Kawaguchi