<MESSAGE> <FROM>sender</FROM> <TO>to</TO> <CONTENT>text</CONTENT> </MESSAGE>Every database field is referenced within an element content, but it is also possible to define maps that use XML attributes, like
<MESSAGE> <FROM RECEIVED_FROM="to">sender</FROM> <CONTENT>text</CONTENT> </MESSAGE>The RECEIVED_FROM attribute is linked to "to" field. Attributes can be used for search parameters as well as elements.
These two maps relate on the fact that every data is contained in the main table. nodeXML can also manage three different situations:
<FROM>%anonymous</FROM>Percentage (%) character indicates that the content is not in the database, but instead it is the following string. In the example of anonymous messages, the node output will have a
<FROM>anonymous</FROM>element for every record.
In the situation described in the second point the following information is needed to retrieve data: the name of the table containing the field (say T), the name of the field (F3), the name of the field in table T that estabilishes the relation (F2) and the corresponding field in the main table (F1). The sintax for the one-to-one relation is the following:
<FROM>otoo(F1,T,F2,F3)</FROM>Finally, in the third case, we suppose that the one-to-many relation is implemented with a cross-relation table between the main table and the one containing the required field. Sintax is
<FROM>otom(F1,T1,F2,F3,T2,F4,F5)</FROM>where F5 is the required field, F4 is the field which links the target table T2 with the cross-relation one (T1), matching with F3 field. F2 is the T1 field that links the cross-relation table with the main one matching with F1.