TiXI
3.3.0
|
Functions | |
DLL_EXPORT ReturnCode | tixiAddExternalLink (const TixiDocumentHandle handle, const char *parentPath, const char *pathOrUrl, const char *filename, AddLinkMode mode) |
Adds a link to an external xml file. More... | |
DLL_EXPORT ReturnCode | tixiRemoveExternalLinks (TixiDocumentHandle handle) |
Removes all link attributes to external files. More... | |
DLL_EXPORT ReturnCode | tixiAddHeader (const TixiDocumentHandle handle, const char *toolName, const char *version, const char *authorName) |
Add header to XML-file. More... | |
DLL_EXPORT ReturnCode | tixiAddCpacsHeader (const TixiDocumentHandle handle, const char *name, const char *creator, const char *version, const char *description, const char *cpacsVersion) |
Add CPACS header to XML-file. More... | |
DLL_EXPORT ReturnCode | tixiCheckElement (const TixiDocumentHandle handle, const char *elementPath) |
Checks if the given element exists. More... | |
DLL_EXPORT ReturnCode | tixiCheckDocumentHandle (const TixiDocumentHandle handle) |
Checks for validity of a document handle. More... | |
DLL_EXPORT ReturnCode | tixiUsePrettyPrint (TixiDocumentHandle handle, int usePrettyPrint) |
Sets Pretty print on or off. More... | |
DLL_EXPORT ReturnCode | tixiSetPrintMsgFunc (TixiPrintMsgFnc func) |
Reroutes all messages of tixi to the message function func. More... | |
DLL_EXPORT TixiPrintMsgFnc | tixiGetPrintMsgFunc () |
Returns the currently registered message handler function. More... | |
DLL_EXPORT ReturnCode | tixiSetCacheEnabled (TixiDocumentHandle handle, int enabled) |
Enables the internal xPath cache. More... | |
These function simply do not fit into one of the other categories.
DLL_EXPORT ReturnCode tixiAddCpacsHeader | ( | const TixiDocumentHandle | handle, |
const char * | name, | ||
const char * | creator, | ||
const char * | version, | ||
const char * | description, | ||
const char * | cpacsVersion | ||
) |
Add CPACS header to XML-file.
Inserts a header containing information on the data set in this file. If an strings equals to NULL an empty element is inserted. This routine should be called right after tixiCreateDocument. An timestamp is automaticly added to the header.
Fortran syntax:
tixi_add_cpacs_header( integer handle, character*n name, character*n creator, character*n version, character*n descripton, character*n cpacs_version, integer error )
[in] | handle | as returned by tixiCreateDocument |
[in] | name | name of the data set |
[in] | creator | string to identify the creator of the file |
[in] | version | string to identify the version of the file |
[in] | description | optional string to set a description to the file |
[in] | cpacsVersion | CPACS version number |
DLL_EXPORT ReturnCode tixiAddExternalLink | ( | const TixiDocumentHandle | handle, |
const char * | parentPath, | ||
const char * | pathOrUrl, | ||
const char * | filename, | ||
AddLinkMode | mode | ||
) |
Adds a link to an external xml file.
The file is linked in the XML as
<externaldata> <path>https://dlr.de/myxmlstore</path> <filename>externaldata-included-1.xml</filename> </externaldata>
Note: the linked external file is not automatically loaded into the document.
Fortran syntax:
tixi_add_external_link( integer handle, character*n parent_path, character*n path, character*n filename, integer error )
[in] | handle | as returned by tixiCreateDocument |
[in] | parentPath | The Path to the element into which the element holding the url should be inserted. |
[in] | pathOrUrl | The parent path or url to the file. |
[in] | filename | The actual name of the xml file. |
[in] | mode | Mode whether to create only the link or load the files into the document. |
DLL_EXPORT ReturnCode tixiAddHeader | ( | const TixiDocumentHandle | handle, |
const char * | toolName, | ||
const char * | version, | ||
const char * | authorName | ||
) |
Add header to XML-file.
Inserts a header containing information on the tool used to create the file, its version and the user. Additionally, the TIXI version is inserted. If an strings equals to NULL an empty element is inserted. This routine shold be called right after tixiCreateDocument.
Fortran syntax:
tixi_add_header( integer handle, character*n tool_name, character*n version, character*n author_name, integer error )
[in] | handle | as returned by tixiCreateDocument |
[in] | toolName | name of the tool used to write the file |
[in] | authorName | string to identify the creator of the file |
[in] | version | string to identify the version of the tool |
DLL_EXPORT ReturnCode tixiCheckDocumentHandle | ( | const TixiDocumentHandle | handle | ) |
Checks for validity of a document handle.
Fortran syntax:
tixi_check_handle( integer handle )
[in] | handle | handle as returned by tixiCreateDocument, tixiOpenDocumentRecursive or tixiOpenDocumentFromHTTP |
DLL_EXPORT ReturnCode tixiCheckElement | ( | const TixiDocumentHandle | handle, |
const char * | elementPath | ||
) |
Checks if the given element exists.
[in] | handle | handle as returned by tixiCreateDocument, tixiOpenDocumentRecursive or tixiOpenDocumentFromHTTP |
[in] | elementPath | an XPath compliant path to an element in the document specified by handle (see section XPath Examples above). |
DLL_EXPORT TixiPrintMsgFnc tixiGetPrintMsgFunc | ( | ) |
Returns the currently registered message handler function.
DLL_EXPORT ReturnCode tixiRemoveExternalLinks | ( | TixiDocumentHandle | handle | ) |
Removes all link attributes to external files.
This does not remove embedded nodes but the references to the filename etc. if TiXI could successfully embed the external files into the main document before. This is e.g. required, if the XML file should be validated against a schema. The external data attributes make validation impossible. To enable validation, this functions removes those extra attributes.
Note: because links to external files are removed, the document cannot be stored anymore split to multiple files.
Assume a main.xml file
which links to an external file extdata.xml
Internally, this external file is embedded into the xml structure after loading the document. Additionally, some metadata attributes are stored into the external nodes to support saving back into the external files. Therefore, when exporting the document to string or saving the complete document into one file the following xml structure is the result:
The tixi function tixiRemoveExternalLinks simply removes the attributes "externalFileName", "externalDataDirectory", and "externalDataNodePath"
Fortran syntax:
tixi_remove_external_links( integer handle, integer error )
[in] | handle | as returned by tixiCreateDocument |
DLL_EXPORT ReturnCode tixiSetCacheEnabled | ( | TixiDocumentHandle | handle, |
int | enabled | ||
) |
Enables the internal xPath cache.
This speeds up xpath queries with repeating same xpathes.
[in] | handle | The document handle of a tixi document. |
[in] | enabled | Boolean, whether to enable the cache or not. |
DLL_EXPORT ReturnCode tixiSetPrintMsgFunc | ( | TixiPrintMsgFnc | func | ) |
Reroutes all messages of tixi to the message function func.
This can be used, to rerout all tixi messages to a log file, to modify the messages, to parse them etc...
Example to keep tixi silent:
[in] | func | The new message receiver function |
DLL_EXPORT ReturnCode tixiUsePrettyPrint | ( | TixiDocumentHandle | handle, |
int | usePrettyPrint | ||
) |
Sets Pretty print on or off.
Set pretty print on or off. This is used when saing a document to a file, or when exporting to a string. 0 turns pretty print off, 1 turns pretty print on. By default, pretty print is turned on.h
Fortran syntax:
tixi_use_pretty_print( integer handle, integer use_pretty_print, integer error )
[in] | handle | handle as returned by tixiOpenDocument |
[in] | usePrettyPrint | flag if output should be pretty printed |