com.[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 void declareAllNamespacesFromSchema(com.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[] xml) | Loads an XML document from a byte array. | |
static Doc loadFromFile(String fileName) | Loads an XML document from a file. | |
static Doc loadFromString(String xml) | Loads an XML document from a string. | |
byte[] saveToBinary(boolean prettyPrint) | Saves an XML document to a byte array, with optional "pretty-print" formatting. | |
byte[] saveToBinary(boolean prettyPrint, String encoding) | Saves an XML document to a byte array, with optional "pretty-print" formatting, with the specified encoding. | |
byte[] saveToBinary(boolean prettyPrint, String encoding, boolean bigEndian, boolean writeBOM) | Saves an XML document to a byte array, with optional "pretty-print" formatting, with the specified encoding. Byte order and Unicode byte-order mark can be specified for Unicode encodings. | |
void saveToFile(String fileName, boolean prettyPrint) | Saves an XML document to a file, with optional "pretty-print" formatting. | |
void saveToFile(String fileName, boolean prettyPrint, boolean omitXmlDecl) | Saves an XML document to a file, with optional "pretty-print" formatting, with UTF-8 encoding. When omitXmlDecl is true, the XML declaration will not be written. | |
void saveToFile(String fileName, boolean prettyPrint, boolean 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, boolean prettyPrint, boolean omitXmlDecl, String encoding, boolean bBigEndian, boolean bBOM) | 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. Byte order and Unicode byte-order mark can be specified for Unicode encodings. | |
void saveToFile(String fileName, boolean prettyPrint, String encoding) | Saves an XML document to a file, with optional "pretty-print" formatting, with the specified encoding. | |
void saveToFile(String fileName, boolean prettyPrint, String encoding, boolean bBigEndian, boolean bBOM) | Saves an XML document to a file, with optional "pretty-print" formatting, with the specified encoding. Byte order and Unicode byte-order mark can be specified for Unicode encodings. | |
String saveToString(boolean prettyPrint) | Saves an XML document to a string, with optional "pretty-print" formatting. | |
String saveToString(boolean prettyPrint, boolean omitXmlDecl) | Saves an XML document to a string, with optional "pretty-print" formatting. When omitXmlDecl is true, the XML declaration will not be written. | |
void setSchemaLocation(String schemaLocation) | Adds an xsi:schemaLocation or xsi:noNamespaceSchemaLocation attribute to the root element. A root element must already exist. |