Interface IXmlGenerator
- Namespace
- SunamoInterfaces.Interfaces
- Assembly
- SunamoInterfaces.dll
Interface for generating XML content.
public interface IXmlGenerator
- Extension Methods
Methods
AppendLine()
Appends a new line to the XML output.
void AppendLine()
EndComment()
Ends an XML comment.
void EndComment()
Insert(int, string)
Inserts text at the specified index.
void Insert(int index, string text)
Parameters
Length()
Gets the length of the generated XML.
int Length()
Returns
- int
The length of the XML content.
StartComment()
Starts an XML comment.
void StartComment()
TerminateTag(string)
Terminates (closes) an XML tag.
void TerminateTag(string tagName)
Parameters
tagNamestringThe name of the tag to terminate.
ToString()
Converts the generated XML to a string.
string ToString()
Returns
- string
The XML content as a string.
WriteCData(string)
Writes a CDATA section.
void WriteCData(string content)
Parameters
contentstringThe content of the CDATA section.
WriteElement(string, string)
Writes an XML element with inner content.
void WriteElement(string elementName, string content)
Parameters
WriteNonPairTag(string)
Writes a self-closing (non-pair) XML tag.
void WriteNonPairTag(string tagName)
Parameters
tagNamestringThe tag name.
WriteNonPairTagWith2Attrs(string, string, string, string, string)
Writes a self-closing tag with two attributes.
void WriteNonPairTagWith2Attrs(string tagName, string firstName, string firstValue, string secondName, string secondValue)
Parameters
tagNamestringThe tag name.
firstNamestringThe first attribute name.
firstValuestringThe first attribute value.
secondNamestringThe second attribute name.
secondValuestringThe second attribute value.
WriteNonPairTagWithAttr(string, string, string)
Writes a self-closing tag with one attribute.
void WriteNonPairTagWithAttr(string tagName, string attrName, string attrValue)
Parameters
tagNamestringThe tag name.
attrNamestringThe attribute name.
attrValuestringThe attribute value.
WriteNonPairTagWithAttrs(bool, string, params string[])
Writes a self-closing tag with multiple attributes, optionally appending null attributes.
void WriteNonPairTagWithAttrs(bool isAppendingNull, string tagName, params string[] attributes)
Parameters
isAppendingNullboolWhether to append null attributes.
tagNamestringThe tag name.
attributesstring[]The attributes as name-value pairs.
WriteNonPairTagWithAttrs(string, List<string>)
Writes a self-closing tag with attributes from a list.
void WriteNonPairTagWithAttrs(string tagName, List<string> attributes)
Parameters
WriteNonPairTagWithAttrs(string, params string[])
Writes a self-closing tag with multiple attributes.
void WriteNonPairTagWithAttrs(string tagName, params string[] attributes)
Parameters
WriteRaw(string)
Writes raw XML content without escaping.
void WriteRaw(string content)
Parameters
contentstringThe raw content to write.
WriteTag(string)
Writes an opening XML tag.
void WriteTag(string tagName)
Parameters
tagNamestringThe tag name.
WriteTagNamespaceManager(object, XmlNamespaceManager, string, string)
Writes a tag with namespace manager and element.
void WriteTagNamespaceManager(object element, XmlNamespaceManager namespaceManager, string namespaceUri, string prefix)
Parameters
elementobjectThe element object.
namespaceManagerXmlNamespaceManagerThe namespace manager.
namespaceUristringThe namespace URI.
prefixstringThe namespace prefix.
WriteTagNamespaceManager(string, XmlNamespaceManager, params string[])
Writes a tag with namespace manager and attributes.
void WriteTagNamespaceManager(string tagName, XmlNamespaceManager namespaceManager, params string[] attributes)
Parameters
tagNamestringThe tag name.
namespaceManagerXmlNamespaceManagerThe namespace manager.
attributesstring[]The attributes as name-value pairs.
WriteTagWith2Attrs(string, string, string, string, string)
Writes an opening tag with two attributes.
void WriteTagWith2Attrs(string tagName, string firstName, string firstValue, string secondName, string secondValue)
Parameters
tagNamestringThe tag name.
firstNamestringThe first attribute name.
firstValuestringThe first attribute value.
secondNamestringThe second attribute name.
secondValuestringThe second attribute value.
WriteTagWithAttr(string, string, string, bool)
Writes an opening tag with one attribute, optionally skipping if empty or null.
void WriteTagWithAttr(string tagName, string attributeName, string attributeValue, bool isSkippingEmptyOrNull = false)
Parameters
tagNamestringThe tag name.
attributeNamestringThe attribute name.
attributeValuestringThe attribute value.
isSkippingEmptyOrNullboolWhether to skip if attribute value is empty or null.
WriteTagWithAttrs(string, List<string>)
Writes an opening tag with attributes from a list.
void WriteTagWithAttrs(string tagName, List<string> attributes)
Parameters
WriteTagWithAttrs(string, params string[])
Writes an opening tag with multiple attributes.
void WriteTagWithAttrs(string tagName, params string[] attributes)
Parameters
WriteTagWithAttrsCheckNull(string, params string[])
Writes an opening tag with attributes, checking for null values.
void WriteTagWithAttrsCheckNull(string tagName, params string[] attributes)
Parameters
WriteXmlDeclaration()
Writes the XML declaration.
void WriteXmlDeclaration()