[YourSchema].[Doc]
When code is generated from an XML Schema, the generated code provides a document class with the same name as the schema. This class contains all possible root elements as members, as well as the members listed below. Note that, in the method names below, "Doc" stands for the name of the generated document class itself.
Methods
Name | Description | |
---|---|---|
static Doc CreateDocument() | Creates a new, empty XML document. | |
static Doc CreateDocument(string encoding) | Creates a new, empty XML document, with encoding of type "encoding". | |
static void DeclareAllNamespacesFromSchema(Altova.Xml.ElementType node) | Declares all namespaces from the XML Schema on the element supplied as argument (typically, the XML root element). Calling this method is useful if your schema has multiple namespace declarations, each mapped to a prefix, and you would like to declare all of them on the element supplied as argument. | |
static Doc LoadFromBinary(byte[] binary) | Loads an XML document from a byte array. | |
static Doc LoadFromFile(string filename) | Loads an XML document from a file. | |
static Doc LoadFromString(string xmlstring) | Loads an XML document from a string. | |
byte[] SaveToBinary(bool prettyPrint) | Saves an XML document to a byte array, with optional "pretty-print" formatting. | |
byte[] SaveToBinary(bool prettyPrint, string encoding) | Saves an XML document to a byte array, with optional "pretty-print" formatting, with the specified encoding. | |
byte[] SaveToBinary(bool prettyPrint, string encoding, bool bBigEndian, bool bBOM) | Saves an XML document to a byte array, with optional "pretty-print" formatting, with the specified encoding, byte order, and BOM (Byte Order Mark). | |
void SaveToFile(string fileName, bool prettyPrint) | Saves an XML document to a file, with optional "pretty-print" formatting. | |
void SaveToFile(string fileName, bool prettyPrint, bool omitXmlDecl) | Saves an XML document to a file, with optional "pretty-print" formatting. When omitXmlDecl is true, the XML declaration will not be written. | |
void SaveToFile(string fileName, bool prettyPrint, bool omitXmlDecl, string encoding) | Saves an XML document to a file, with optional "pretty-print" formatting, with the specified encoding. When omitXmlDecl is true, the XML declaration will not be written. | |
void SaveToFile(string fileName, bool prettyPrint, string encoding, string lineend) | Saves an XML document to a file, with optional "pretty-print" formatting, with the specified encoding, and line ending character(s). | |
void SaveToFile(string fileName, bool prettyPrint, bool omitXmlDecl, string encoding, string lineend) | Saves an XML document to a file, with optional "pretty-print" formatting, with the specified encoding, and line ending character(s). When omitXmlDecl is true, the XML declaration will not be written. | |
void SaveToFile(string fileName, bool prettyPrint, bool omitXmlDecl, string encoding, bool bBigEndian, bool bBOM, string lineend) | Saves an XML document to a file, with optional "pretty-print" formatting, with the specified encoding, byte order, BOM (Byte Order Mark), and line ending character(s). When omitXmlDecl is true, the XML declaration will not be written. | |
void SaveToFileWithLineEnd(string fileName, bool prettyPrint, bool omitXmlDecl, string lineend) | Saves an XML document to a file, with optional "pretty-print" formatting, and line ending character(s). When omitXmlDecl is true, the XML declaration will not be written. | |
string SaveToString(bool prettyPrint) | Saves an XML document to a file, with optional "pretty-print" formatting. | |
string SaveToString(bool prettyPrint, bool omitXmlDecl) | Saves an XML document to a file, with optional "pretty-print" formatting. When omitXmlDecl is true, the XML declaration will not be written. | |
void SetDTDLocation(string dtdLocation) | Adds a DOCTYPE declaration with the specified system ID. A root element must already exist. | |
void SetSchemaLocation(string schemaLocation) | Adds an xsi:schemaLocation or xsi:noNamespaceSchemaLocation attribute to the root element. A root element must already exist. |