TiXI
3.3.0
|
The following exmaple assume the XML example from section XPath Examples to be stored in a file named ju.xml.
#include "tixi.h" char* xmlFilename = "ju.xml"; TixiDocumentHandle handle = -1; char * elementPath = "/plane/wings/wing[1]"; char* attributeName = "position"; char* attributeValue; tixiOpenDocument( xmlFilename, &handle ); tixiGetTextAttribute( handle, elementPath, attributeName, &attributeValue ); tixiCloseDocument( handle );
#include "tixi.h" char* xmlFilename = "ju.xml"; TixiDocumentHandle handle = -1; char * elementPath = "/plane/coordinateOrigin/x"; double x = 0.; tixiOpenDocument( xmlFilename, &handle ); tixiGetDoubleElement( handle, elementPath, &x ); tixiCloseDocument( handle );