|Version 6 (modified by 13 years ago) ( diff ),|
XSLT and XPath are two key technologies used within SahanaPy to allow easy importing and exporting of information in a wide variety of formats. Support for importing and exporting data is mostly managed via XSLT templates.
Sahana Data Models
The underlying data models in
models/ define the resulting structure that will be within <sahanapy>.
Sahana XSLT Information
Sahana XSLT/XPath capability is provided by lxml. Currently Sahana only supports XSLT/XPath 1.0.
Sahana XML Representation
Here is a simplified blank XML document that highlights the key elements providing in the native XML within SahanaPy.
<sahanapy> <resource name="" uuid="" created_on="" modified_on="" url=""> <data field=""></data> <reference field="" resource="" uuid=""></reference> </sahanapy>
<resource>- identifies the type of resource e.g. name="hms_hospital"
<data>- represents a data field from the model e.g. if a resource is hms_hospital, then the data fields provided will be defined in
models/hms.py- look for the resource definition for hospital
<reference>- contains information about things such as location e.g.
Exporting Data from Sahana
Sahana export templates are stored in:
Importing Data from Sahana
Sahana import templates are stored in:
Background Info and Resources
- XSLT V2 reference on W3C
- XPath V2 reference on W3C
- XSLT Tutorial on w3schools
- XPath Tutorial on w3schools