# Elementname: `SaveDataset`

## Description

Saves an element/attribute structure to be used in the next publisher run. The contents must have a tree structure.

Allowed attributes: attributes, elementname, name, select

Child elements: Copy-of, Element, ForAll, Loop, Makeindex, SortSequence

Parent elements: AtPageCreation, AtPageShipout, Case, Contents, ForAll, Loop, Otherwise, Record, SavePages, Until, While

### Attributes

attributes (XPath Expression, optional)

  The variable (as an XPath expression, e.g. `$foo`) which contains Attribute Elements. These attributes are added to the root element.

elementname (text)

  Name of the root element that surrounds the elements given by the child elements.

name (text)

  Name of the file. Example: toc

select (XPath Expression, optional)

  Alternative to giving the data structure in the child elements.

## Example

      <Record element="data">
        <SetVariable variable="attributesvar">
          <Attribute name="att1" select="'Hello'" />
          <Attribute name="att2" select="123" />
        </SetVariable>

        <SaveDataset filename="toc" elementname="root" attributes="$attributesvar">
          <Element name="child">
            <Attribute name="attchild" select="999"/>
          </Element>
        </SaveDataset>
      </Record>

This code saves an XML file to the disc which has this structure:

    <root att1="Hello" att2="123">
     <child attchild="999"/>
    </root>

## See also

Element, Attribute, LoadDataset, How to generate a table of contents and other directories

# Commands

- A
- Action
- AddSearchpath
- AtPageCreation
- AtPageShipout
- AttachFile
- Attribute
- B
- Barcode
- Bold
- BoldItalic
- Bookmark
- Box
- Br
- Case
- Circle
- Color
- Column
- Columns
- Compatibility
- Contents
- Copy-of
- DefineColor
- DefineFontalias
- DefineFontfamily
- DefineTextformat
- Element
- Fontface
- ForAll
- Frame
- Grid
- Group
- Groupcontents
- HSpace
- Hyphenation
- I
- Image
- Include
- Initial
- InsertPages
- Italic
- Layout
- Li
- LoadDataset
- LoadFontfile
- Loop
- Makeindex
- Margin
- Mark
- Message
- NewPage
- NextFrame
- NextRow
- NoBreak
- Ol
- Options
- Otherwise
- Output
- Overlay
- PDFOptions
- Pageformat
- Pagetype
- Paragraph
- PlaceObject
- Position
- PositioningArea
- PositioningFrame
- ProcessNode
- Record
- Regular
- Rule
- SaveDataset
- SavePages
- SetGrid
- SetVariable
- SortSequence
- Span
- Stylesheet
- Sub
- Sup
- Switch
- Table
- TableNewPage
- Tablefoot
- Tablehead
- Tablerule
- Td
- Text
- Textblock
- Tr
- Trace
- Transformation
- U
- URL
- Ul
- Until
- VSpace
- Value
- While

Version: 3.4.1 | Start page | Command reference | Other language: German