TiXI
3.3.0
|
Functions | |
DLL_EXPORT ReturnCode | tixiOpenDocument (const char *xmlFilename, TixiDocumentHandle *handle) |
Open an XML-file for reading. More... | |
DLL_EXPORT ReturnCode | tixiOpenDocumentRecursive (const char *xmlFilename, TixiDocumentHandle *handle, OpenMode oMode) |
Open an XML-file for reading. It acts like tixiOpenDocument. More... | |
DLL_EXPORT ReturnCode | tixiOpenDocumentFromHTTP (const char *httpURL, TixiDocumentHandle *handle) |
Open an XML-file for reading from a http web resource. More... | |
DLL_EXPORT ReturnCode | tixiCreateDocument (const char *rootElementName, TixiDocumentHandle *handle) |
Create an XML-document. More... | |
DLL_EXPORT ReturnCode | tixiGetDocumentPath (TixiDocumentHandle handle, char **documentPath) |
Returns the file path to the document. More... | |
DLL_EXPORT ReturnCode | tixiSaveDocument (TixiDocumentHandle handle, const char *xmlFilename) |
Write XML-document to disk. More... | |
DLL_EXPORT ReturnCode | tixiSaveCompleteDocument (TixiDocumentHandle handle, const char *xmlFilename) |
Write XML-document with all external data to disk. More... | |
DLL_EXPORT ReturnCode | tixiSaveAndRemoveDocument (TixiDocumentHandle handle, const char *xmlFilename) |
Write XML-document with all external data to disk. More... | |
DLL_EXPORT ReturnCode | tixiCloseDocument (TixiDocumentHandle handle) |
Close an XML-document. More... | |
DLL_EXPORT ReturnCode | tixiCloseAllDocuments () |
Close all open documents. More... | |
DLL_EXPORT ReturnCode | tixiCleanup () |
Closes the xml2 library and frees its allocated variables. More... | |
DLL_EXPORT ReturnCode | tixiExportDocumentAsString (const TixiDocumentHandle handle, char **text) |
Returns the Document as one text. More... | |
DLL_EXPORT ReturnCode | tixiImportFromString (const char *xmlImportString, TixiDocumentHandle *handle) |
Imports a char-string into a new tixi-document. More... | |
Function to open, create, close, and save XML-files.
DLL_EXPORT ReturnCode tixiCleanup | ( | ) |
Closes the xml2 library and frees its allocated variables.
DLL_EXPORT ReturnCode tixiCloseAllDocuments | ( | ) |
Close all open documents.
Closes all XML-documents. This routine could be called at the of a program to free allocated memory. After calling this routine all current handles are invalid and no further processing of the document is possible.
Fortran syntax:
tixi_close_all_documents( integer error )
DLL_EXPORT ReturnCode tixiCloseDocument | ( | TixiDocumentHandle | handle | ) |
Close an XML-document.
Closes an XML-document. This routine should be called after the processing of an XML-document is completed. After calling this routine the handle is invalid and no further processing of the document is possible. It must be called after tixiSaveDocument.
Fortran syntax:
tixi_close_document( integer handle, integer error )
[in] | handle | file handle as returned by tixiOpenDocument, tixiOpenDocumentRecursive, tixiOpenDocumentFromHTTP, tixiCreateDocument or tixiImportFromString |
DLL_EXPORT ReturnCode tixiCreateDocument | ( | const char * | rootElementName, |
TixiDocumentHandle * | handle | ||
) |
Create an XML-document.
Initializes a data structure to hold an XML-document.
Fortran syntax:
tixi_create_document( character*n root_element_name, integer handle, integer error )
[in] | rootElementName | name of the root element of the XML-document |
[out] | handle | handle to an XML-document. This handle is used in calls to other TIXI functions. |
DLL_EXPORT ReturnCode tixiExportDocumentAsString | ( | const TixiDocumentHandle | handle, |
char ** | text | ||
) |
Returns the Document as one text.
Returns the text content of the document specified by handle. If an error occurs text is set to NULL. On successful return the memory used for text is allocated internally and must not be released by the user. The deallocation is handle when the document referred to by handle is closed. If OpenMode=OPENMODE_RECURSIVE, text will be one big string with all external xml files included.
Fortran syntax:
tixi_export_document_as_string( integer handle, character*n text, integer error )
[in] | handle | handle as returned by tixiOpenDocument, tixiOpenDocumentRecursive, tixiOpenDocumentFromHTTP, tixiCreateDocument or tixiImportFromString |
[out] | text | text content of the document |
DLL_EXPORT ReturnCode tixiGetDocumentPath | ( | TixiDocumentHandle | handle, |
char ** | documentPath | ||
) |
Returns the file path to the document.
The path is empty, if the document was not opened, but created by tixiCreateDocument.
[in] | handle | document handle as returned by tixiOpenDocument, tixiOpenDocumentRecursive, tixiOpenDocumentFromHTTP, tixiCreateDocument or tixiImportFromString |
[out] | documentPath | Path to the file, opened by tixiOpenDocument, tixiOpenDocumentRecursive, tixiOpenDocumentFromHTTP The path is a null pointer, if the document was created by tixiCreateDocument or tixiImportFromString |
DLL_EXPORT ReturnCode tixiImportFromString | ( | const char * | xmlImportString, |
TixiDocumentHandle * | handle | ||
) |
Imports a char-string into a new tixi-document.
Creates a new TIXI-document with the content of the string and checks if it is well formed. To validate the document against a XML-Schema or DTD use tixiSchemaValidateFromFile, tixiSchemaValidateFromString or tixiDTDValidate.
Fortran syntax:
tixi_import_from_string( character*n xmlImportString, integer handle, integer error )
[in] | xmlImportString | the string with the xml-content |
[out] | handle | handle to the XML-document. This handle is used in calls to other TIXI functions. |
DLL_EXPORT ReturnCode tixiOpenDocument | ( | const char * | xmlFilename, |
TixiDocumentHandle * | handle | ||
) |
Open an XML-file for reading.
Opens an XML-file specified by xmlFilename for reading and checks if it is well formed. To validate the document against a XML-Schema or DTD use tixiSchemaValidateFromFile, tixiSchemaValidateFromString or tixiDTDValidate.
Fortran syntax:
tixi_open_document( character*n xml_filename, integer handle, integer error )
[in] | xmlFilename | name of the XML-file to be opened |
[out] | handle | handle to the XML-document. This handle is used in calls to other TIXI functions. |
DLL_EXPORT ReturnCode tixiOpenDocumentFromHTTP | ( | const char * | httpURL, |
TixiDocumentHandle * | handle | ||
) |
Open an XML-file for reading from a http web resource.
Opens an XML-file specified by httpURL for reading and checks if it is well formed. To validate the document against a XML-Schema or DTD use tixiSchemaValidateFromFile, tixiSchemaValidateFromString or tixiDTDValidate.
Fortran syntax:
tixi_open_document_from_http( character*n xml_httpurl, integer handle, integer error )
[in] | httpURL | url of the XML-file to be opened |
[out] | handle | handle to the XML-document. This handle is used in calls to other TIXI functions. |
DLL_EXPORT ReturnCode tixiOpenDocumentRecursive | ( | const char * | xmlFilename, |
TixiDocumentHandle * | handle, | ||
OpenMode | oMode | ||
) |
Open an XML-file for reading. It acts like tixiOpenDocument.
If OpenMode is OPENMODE_PLAIN, only the given xml is opened. If OpenMode is OPENMODE_RECURSIVE, external xml files will be integrated into the xml tree by linking them into the main xml file. The user now has only one big xml file. In the path node has be be a valid URI. This uri could adress a relativ or absolut file path, or a http url. Example values for the path node are:
Examples for the externaldata node:
Fortran syntax:
tixi_open_document_recursive( character*n xml_filename, integer handle, integer openmode, integer error )
[in] | xmlFilename | name of the XML-file to be opened |
[out] | handle | handle to the XML-document. This handle is used in calls to other TIXI functions. |
[in] | oMode | Enum of the mode to open (OPENMODE_PLAIN / OPENMODE_RECURSIVE). |
DLL_EXPORT ReturnCode tixiSaveAndRemoveDocument | ( | TixiDocumentHandle | handle, |
const char * | xmlFilename | ||
) |
Write XML-document with all external data to disk.
The document is written into a file specified by xmlFilename. The user should validate the document before it is written to disk. Memory allocated internally for processing this document has to be released by tixiCloseDocument.
If the file was opened with OpenMode=OPENMODE_RECURSIVE and external file where linked into the main XML document, these additional nodes will be saved in the xml file as well. The external nodes will be removed from the main xml-document.
Fortran syntax:
tixi_save_and_remove_document( integer handle, character*n xml_filename, integer error )
[in] | handle | document handle as returned by tixiOpenDocument, tixiOpenDocumentRecursive, tixiOpenDocumentFromHTTP, tixiCreateDocument or tixiImportFromString |
[in] | xmlFilename | name of the file to be created. |
DLL_EXPORT ReturnCode tixiSaveCompleteDocument | ( | TixiDocumentHandle | handle, |
const char * | xmlFilename | ||
) |
Write XML-document with all external data to disk.
The document is written into a file specified by xmlFilename. The user should validate the document before it is written to disk. Memory allocated internally for processing this document has to be released by tixiCloseDocument.
If the file was opened with OpenMode=OPENMODE_RECURSIVE and external file where linked into the main XML document, these additional nodes will be saved in the xml file as well. The external nodes will not be removed from the main xml-document.
Fortran syntax:
tixi_save_complete_document( integer handle, character*n xml_filename, integer error )
[in] | handle | document handle as returned by tixiOpenDocument, tixiOpenDocumentRecursive, tixiOpenDocumentFromHTTP, tixiCreateDocument or tixiImportFromString |
[in] | xmlFilename | name of the file to be created. |
DLL_EXPORT ReturnCode tixiSaveDocument | ( | TixiDocumentHandle | handle, |
const char * | xmlFilename | ||
) |
Write XML-document to disk.
The document is written into a file specified by xmlFilename. The user should validate the document before it is written to disk. Memory allocated internally for processing this document has to be released by tixiCloseDocument.
If the file was opened with OpenMode=OPENMODE_RECURSIVE and external file where linked into the main XML tree, please note that these files are saved back into the external files. The external nodes will not be removed from the main xml-document.
Fortran syntax:
tixi_save_document( integer handle, character*n xml_filename, integer error )
[in] | handle | document handle as returned by tixiOpenDocument, tixiOpenDocumentRecursive, tixiOpenDocumentFromHTTP, tixiCreateDocument or tixiImportFromString |
[in] | xmlFilename | name of the file to be created. |