User Tools

Site Tools


computing:epeios:tools:dpkq:data

The data file

The data file is an XML file containing at least one table, which records can refer to records in other table, like a relational database. The content of such a data file is like this :

<?xml version="1.0" encoding="utf-8"?>
<dpk:data>
	<dpk:table label="Table1Label">
		<dpk:content DefaultRecordLabelTag="Table1FieldX">
			<Table1RecordTag dpk:label="Table1Record1Label">
				<Table1Field1>Table1Field1Data1</Table1Field1>
				<Table1Field2>Table1Field2Data1</Table1Field2>
				...
			</Table1RecordTag>
			<Table1RecordTag dpk:label="Table1Record2Label">
				<Table1Field1>Table1Field1Data2</Table1Field1>
				<Table1Field2>Table1Field2Data2</Table1Field2>
				...
			</Table1RecordTag>
			...
		</dpk:content>
	</dpk:table>
	<dpk:table label="Table2Label">
		<dpk:aliases label="%RL%" TableLabel="Table1">
			<dpk:alias label="Table1RecordXAlias" TableLabel="Table1"/>
		</dpk:aliases>
		<dpk:content DefaultRecordLabelTag="Table2FieldX">
			<Table2RecordTag dpk:label="Table2Record1Label">
				<dpk:insert RecordAlias="Table2RecordXAlias"/>
				<Table2Field1>Table2Field1Data1</Table2Field1>
				<Table2Field2>Table2Field2Data1</Table2Field2>
				...
			</Table2RecordTag>
			<Table2RecordTag dpk:label="Table2Record2Label">
				<dpk:insert RecordAlias="Table2RecordXAlias"/>
				<Table2Field1>Table2Field1Data2</Table2Field1>
				<Table2Field2>Table2Field2Data2</Table2Field2>
				...
			</Table2RecordTag>
			...
		</dpk:content>
	</dpk:table>
	...
</dpk:data>

The dpk: prefixed tags or attributes, or the attributes in a dpk: prefixed tag are keywords recognized by dpkq and had to be written as is. However, it is possible to use another namespace as dpk (see dpkq --help for details).

The DefaultRecordLabelTag attribute is optional, and allows to specify the tag which value is used for each record as its label. This can be supersede by putting a dpk:label attribute to the concerned record.

The dpk:aliases tag can be used to define aliases for records or for tables. When the label attribute is defined, its value is used to generate an alias for each record of the table which label is given in the TableLabel attribute, or alias with the TableAlias attribute. The label attribute can contain following markers (and should, at least, contain the %RI% or %RL% marker):

  • %RI%: index of the record,
  • %RL%: label of the record,
  • %TI%: index of the table,
  • %TL%: label of the table,
  • %%: the % character.

You can specify an alias for a table with the dpk:alias tag (which have to be enclosed by a dpk:aliases tag). The label attribute specifies the alias label, the TableLabel attribute the label of the table to which the alias is affected.

The same dpk:alias tag can be used to explicitly specify a record alias, or supersede record aliases defined with the dpk:aliases tag. The label attribute contains the record alias label, and the table owning the record has to be specified by its label or alias by defining a TableLabel attribute or a TableAlias attribute. The table related attribute is not needed if the table is specified by its label or alias in the enclosing dpk:aliases tag.

A dpk:table can contain several (or no) dpk:aliases tags, which can contain several (or no) dpk:alias tag.

In addition of the optional dpk:label attribute, each record can have a dpk:Handling attribute, which can contain following values :

  • Skip : the record is skipped, i. e. never picked,
  • Ignore : the record is ignored, as it does not exists.

You can insert in a record the content of the record of another table by using the dpk:insert tag. The record is specified by its alias with the RecordAlias attribute, or by its label by the RecordLabel attribute. When using this latter, you have to specify the owning table by its label or alias by defining the TableLabel attribute, or the TableAliase attribute. There can be several (or no) dpk:insert tag in a record.

computing/epeios/tools/dpkq/data.txt · Last modified: Tue Sep 1 21:47:08 2015 (01/09/15) by Claude SIMON