C# (CSharp) SimpleFramework.Xml.Stream Namespace

Classes

Name Description
Attribute The Attribute interface represents an attribute that is associated with an event node. An attribute is required to provide the name and value for the attribute, and optionally the namespace reference and prefix. For debugging purposes the source object from the internal XML provider can be returned also.
CamelCaseBuilder The CamelCaseBuilder is used to represent an XML style that can be applied to a serialized object. A style can be used to modify the element and attribute names for the generated document. This styles can be used to generate camel case XML. <ExampleElement> <ChildElement exampleAttribute='example'> <InnerElement>example</InnerElement> </ChildElement> </ExampleElement> Above the camel case XML elements and attributes can be generated from a style implementation. Styles enable the same objects to be serialized in different ways, generating different styles of XML without having to modify the class schema for that object.
CamelCaseBuilder.Attribute This is used to parse the style for this builder. This takes all of the words split from the original string and builds all of the processed tokens for the styles elements and attributes.
CamelCaseBuilder.Element This is used to parse the style for this builder. This takes all of the words split from the original string and builds all of the processed tokens for the styles elements and attributes.
CamelCaseStyle The CamelCaseStyle is used to represent an XML style that can be applied to a serialized object. A style can be used to modify the element and attribute names for the generated document. This styles can be used to generate camel case XML. <ExampleElement> <ChildElement exampleAttribute='example'> <InnerElement>example</InnerElement> </ChildElement> </ExampleElement> Above the camel case XML elements and attributes can be generated from a style implementation. Styles enable the same objects to be serialized in different ways, generating different styles of XML without having to modify the class schema for that object.
EventAttribute The EventAttribute object represents an attribute that is associated with an event node. An attribute is required to provide the name and value for the attribute, and optionally the namespace reference and prefix. For debugging purposes the source object from the internal XML provider can be acquired.
EventElement The EventElement object is used to represent an event that has been extracted from the XML document. Events provide a framework neutral way to represent a token from the source XML. It provides the name and value of the event, if applicable, and also provides namespace information. Some nodes will have associated Attribute objects, typically these will be the XML element events. Also, if available, the event will provide the line number the event was encountered in the XML.
EventToken The EventToken object is used to represent an event that has been extracted from the XML document. Events provide a framework neutral way to represent a token from the source XML. It provides the name and value of the event, if applicable, and also provides namespace information. Some nodes will have associated Attribute objects, typically these will be the XML element events. Also, if available, the event will provide the line number the event was encountered in the XML.
Format The Format object is used to provide information on how a generated XML document should be structured. The information provided tells the formatter whether an XML prolog is required and the number of spaces that should be used for indenting. The prolog specified will be written directly before the XML document.

Should a Format be created with an indent of zero or less then no indentation is done, and the generated XML will be on the same line. The prolog can contain any legal XML heading, which can domain a DTD declaration and XML comments if required.

Formatter The Formatter object is used to format output as XML indented with a configurable indent level. This is used to write start and end tags, as well as attributes and values to the given writer. The output is written directly to the stream with and indentation for each element appropriate to its position in the document hierarchy. If the indent is set to zero then no indent is performed and all XML will appear on the same line.
HyphenBuilder The HyphenBuilder is used to represent an XML style that can be applied to a serialized object. A style can be used to modify the element and attribute names for the generated document. This styles can be used to generate hyphenated XML. <example-element> <child-element example-attribute='example'> <inner-element>example</inner-element> </child-element> </example-element> Above the hyphenated XML elements and attributes can be generated from a style implementation. Styles enable the same objects to be serialized in different ways, generating different styles of XML without having to modify the class schema for that object.
HyphenBuilder.Parser This is used to parse the style for this builder. This takes all of the words split from the original string and builds all of the processed tokens for the styles elements and attributes.
HyphenStyle The HyphenStyle is used to represent an XML style that can be applied to a serialized object. A style can be used to modify the element and attribute names for the generated document. This styles can be used to generate hyphenated XML. <example-element> <child-element example-attribute='example'> <inner-element>example</inner-element> </child-element> </example-element> Above the hyphenated XML elements and attributes can be generated from a style implementation. Styles enable the same objects to be serialized in different ways, generating different styles of XML without having to modify the class schema for that object.
Indenter The Indenter is used create indent strings using the stack paradigm. This allows XML documents to be generated by pushing and popping indents onto the stack. This indenter caches all indent strings created so that when the same position on the stack is encountered the indent can be acquired quickly.

The indents created by this are all prefixed with the line feed character, which allows XML tags to span exclusive lines. If the indent size specified is zero or less then no spaces, or line feed will be added to the generated indent string.

Indenter.Cache The Cache object is used create an indexable list which allows the indenter to quickly acquire an indent using a stack position. This ensures that the indenter need only create an index once for a given stack position. The number of indents held within this cache can also be tracked.
InputAttribute The InputAttribute is used to represent an attribute within an element. Rather than representing an attribute as a name value pair of strings, an attribute is instead represented as an input node, in the same manner as an element. The reason for representing an attribute in this way is such that a uniform means of extracting and parsing values can be used for inputs.
InputElement The InputElement represents a self contained element that will allow access to its child elements. If the next element read from the NodeReader is not a child then this will return null. The input element node also allows the attribute values associated with the node to be accessed.
InputPosition The InputPosition object is used to acquire the line number within the XML document. This allows debugging to be done when a problem occurs with the source document. This object can be converted to a string using the toString method.
NamespaceAttributeTest
NamespaceMap The NamespaceMap object is used store the namespaces for an element. Each namespace added to this map can be added with a prefix. A prefix is added only if the associated reference has not been added to a parent element. If a parent element has the associated reference, then the parents prefix is the one that will be returned when requested from this map.
Node The Node is used to represent a name value pair and acts as the base form of data used within the framework. Each of the attributes and elements are represented as nodes.
NodeBuilder The NodeBuilder object is used to create either an input node or an output node for a given source or destination. If an InputNode is required for reading an XML document then a reader must be provided to read the content from.

If an OutputNode is required then a destination is required. The provided output node can be used to generate well formed XML to the specified writer.

NodeException The NodeException is thrown to indicate the state of either the input node or output node being invalid. Typically this is thrown if some illegal operation is requested.
NodeReader The NodeReader object is used to read elements from the specified XML event reader. This reads input node objects that represent elements within the source XML document. This will allow details to be read using input node objects, as long as the end elements for those input nodes have not been ended.

For example, if an input node represented the root element of a document then that input node could read all elements within the document. However, if the input node represented a child element then it would only be able to read its children.

NodeReaderTest
NodeWriter 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.

NodeWriterTest
OutputAttribute The OutputAttribute object is used to represent a node added to the output node map. It represents a simple name value pair that is used as an attribute by an output element. This shares its namespaces with the parent element so that any namespaces added to the attribute are actually added to the parent element, which ensures correct scoping.
OutputBuffer This is primarily used to replace the StringBuffer class, as a way for the Formatter to store the start tag for an XML element. This enables the start tag of the current element to be removed without disrupting any of the other nodes within the document. Once the contents of the output buffer have been filled its contents can be emitted to the writer object.
OutputDocument The OutputDocument object is used to represent the root of an XML document. This does not actually represent anything that will be written to the generated document. It is used as a way to create the root document element. Once the root element has been created it can be committed by using this object.
OutputElement The OutputElement object represents an XML element. Attributes can be added to this before ant child element has been acquired from it. Once a child element has been acquired the attributes will be written an can no longer be manipulated, the same applies to any text value set for the element.
PrefixResolver The PrefixResolver object will store the namespaces for an element. Each namespace added to this map can be added with a prefix. A prefix is added only if the associated reference has not been added to a parent element. If a parent element has the associated reference, then the parents prefix is the one that will be returned when requested from this map.
PrefixResolverTest
Provider The Provider object is used to represent the provider of an XML parser. All XML parsers are represented as an event reader much like the StAX event reader. Providing a interface to the parser in this manner ensures that the core framework is not coupled to any specific implementation and also ensures that it should run in multiple environments that may support specific XML parsers.
ProviderFactory The ProviderFactory object is used to instantiate a provider of XML parsing to the framework. This scans the classpath for the classes required for StAX, if they are present then this is what will be used to process XML. If however StAX can not be used then a DOM implementation is provided. A DOM provider as a default suits most .NET profiles as it is a very common parser.
Splitter The Splitter object is used split up a string in to tokens that can be used to create a camel case or hyphenated text representation of the string. This will preserve acronyms and numbers and splits tokens by case and character type. Examples of how a string would be splitted are as follows. CamelCaseString = "Camel" "Case" "String" hyphenated-text = "hyphenated" "text" URLAcronym = "URL" "acronym" RFC2616.txt = "RFC" "2616" "txt" By splitting strings in to individual words this allows the splitter to be used to assemble the words in a way that adheres to a specific style. Each style can then be applied to an XML document to give it a consistent format.
StrategyTest
StreamProvider The StreamProvider object is used to provide event reader implementations for StAX. Wrapping the mechanics of the StAX framework within a Provider ensures that it can be plugged in without any dependencies. This allows other parsers to be swapped in should there be such a requirement.
StreamReader The StreamReader object provides an implementation for reading XML events using StAX. This will pretty much wrap core StAX events as the framework is very closely related. The implementation is basically required to ensure StAX events can be digested by the core reader. For performance this will match the underlying implementation closely as all this basically does is act as a means to adapt the underlying framework events.
StreamReader.End The End object is used to represent the end of an element. It is used by the core reader to determine which nodes are in context and which ones are out of context. This allows the input nodes to determine if it can read any more children.
StreamReader.Entry The Entry object is used to represent an attribute within a start element. This holds the name and value of the attribute as well as the namespace prefix and reference. These details can be used to represent the attribute so that should the core reader require these details they can be acquired.
StreamReader.Start The Start object is used to represent the start of an XML element. This will hold the attributes associated with the element and will provide the name, the namespace reference and the namespace prefix. For debugging purposes the source XML element is provided for this start event.
StreamReader.Text The Text object is used to represent a text event. If wraps a node that holds text consumed from the document. These are used by InputNode objects to extract the text values for elements For debugging this exposes the node.
Style The Style interface is used to represent an XML style that can be applied to a serialized object. A style can be used to modify the element and attribute names for the generated document. Styles can be used to generate hyphenated or camel case XML. <example-element> <child-element example-attribute='example'> <inner-element>example</inner-element> </child-element> </example-element> Above the hyphenated XML elements and attributes can be generated from a style implementation. Styles enable the same objects to be serialized in different ways, generating different styles of XML without having to modify the class schema for that object.