packet

5reg

packet

Replaced by different elements for different packet types

Content Model
    packet ::= (type-specific content,
                &xml-tag;*, &xml-packet;*)
The contents of a `packet` element depend upon the particular type of packet (such as container, text, triangulation and so on). The specific content model for each packet type is documented on its own reference page; see below for details.
Attributes
Name | Type | Version
`label` | `CDATA` (required) |
`parent` | `CDATA` |
`type` | `CDATA` |
`typeid` | `NUMBER` (required) |
`id` | `CDATA` | &attraddedver;4.95

&eltdepver;7.0

## Description

In ®ina; 6.0.1 and earlier, the &xml-packet; element was used to store every packet in the entire packet tree that makes up a ®ina; data file. Since ®ina; 7.0, each packet type has its own &xml; element, and &xml-packet; is no longer used.

A &xml-packet; element represents a single packet in a ®ina; data file. A packet is a single data object, such as a triangulation, a text note or a &python; script. A general discussion of packets and their different types can be found in the users' handbook.

The precise &xml-packet; content model differs between packet types. These type-specific content models are individually documented on the following reference pages.

- &xml-packet-dim2triangulation;

- &xml-packet-dim3triangulation;

- &xml-packet-dim4triangulation;

- &xml-packet-triangulation;

- &xml-packet-link;

- &xml-packet-anglestructurelist;

- &xml-packet-container;

- &xml-packet-normalsurfacelist;

- &xml-packet-normalhypersurfacelist;

- &xml-packet-pdf;

- &xml-packet-script;

- &xml-packet-snappea;

- &xml-packet-surfacefilter;

- &xml-packet-text;

Each packet may have an arbitrary set of string tags associated with it; these are represented by the child &xml-tag; elements.

Packets in a data file are arranged in a tree structure; each packet (aside from the top-level packet) has a single parent packet and zero or more child packets. The child packets of this packet are represented by the child &xml-packet; elements of this element.

### Parents

The following elements contain `packet`:

- &xml-packet;
- &xml-reginadata;

.

### Children

The following elements occur in `packet` regardless of packet type:

- &xml-packet;
- &xml-tag;

.

Additional elements may also occur for specific packet types; these are documented on separate reference pages for each individual packet type (see above).

## Attributes

`label`

- The label of this particular packet, i.e., the name associated with this packet in the overall packet tree.

`parent`

- The label of the parent of this packet in the overall packet tree. This attribute should be the empty string if this packet has no parent (i.e., this packet is the root of the entire packet tree).

`type`

- The packet type expressed as a human-readable string. Example types are `Container`, `Text` and `Triangulation`.

`typeid`

- The packet type expressed as an internal identification code. This will be a positive integer.

`id`

- A unique identifier for this packet. Packets are not required to have IDs, but when they are present they must be distinct (i.e., no packets in the same file may share the same ID). IDs do not need to be human-readable, must not contain leading or trailing whitespace, and must not be empty strings. Currently, IDs are built from base 64 hashes of the underlying C++ pointers.

  The purpose of these packet IDs is to allow other packets to reference this packet (for instance, so that a script packet can store references to its variables).

  IDs are not required to stay the same across subsequent loads and saves of the same file. In other words, if you load a file and save it again, the packet IDs are allowed to change.