Altova XMLSpy 2025 Enterprise Edition

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

ic_method

static Doc CreateDocument()

Creates a new, empty XML document.

ic_method

static Doc CreateDocument(string encoding)

Creates a new, empty XML document, with encoding of type "encoding".

ic_method

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.

ic_method

static Doc LoadFromBinary(byte[] binary)

Loads an XML document from a byte array.

ic_method

static Doc LoadFromFile(string filename)

Loads an XML document from a file.

ic_method

static Doc LoadFromString(string xmlstring)

Loads an XML document from a string.

ic_method

byte[] SaveToBinary(bool prettyPrint)

Saves an XML document to a byte array, with optional "pretty-print" formatting.

ic_method

byte[] SaveToBinary(bool prettyPrint, string encoding)

Saves an XML document to a byte array, with optional "pretty-print" formatting, with the specified encoding.

ic_method

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).

ic_method

void SaveToFile(string fileName, bool prettyPrint)

Saves an XML document to a file, with optional "pretty-print" formatting.

ic_method

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.

ic_method

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.

ic_method

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).

ic_method

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.

ic_method

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.

ic_method

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.

ic_method

string SaveToString(bool prettyPrint)

Saves an XML document to a file, with optional "pretty-print" formatting.

ic_method

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.

ic_method

void SetDTDLocation(string dtdLocation)

Adds a DOCTYPE declaration with the specified system ID. A root element must already exist.

ic_method

void SetSchemaLocation(string schemaLocation)

Adds an xsi:schemaLocation or xsi:noNamespaceSchemaLocation attribute to the root element. A root element must already exist.

© 2018-2024 Altova GmbH