Skip to content

Commit 2d4f8aa

Browse files
committed
[doc] add serialization options to file:sync
1 parent 794a373 commit 2d4f8aa

File tree

1 file changed

+25
-1
lines changed
  • src/main/xar-resources/data/docs/file

1 file changed

+25
-1
lines changed

src/main/xar-resources/data/docs/file/sync.md

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,31 @@ or a map of options.
66

77
## Options Map
88

9-
The map has three keys at the moment:
9+
Serialization options (only applies to XML files at the moment) lets you
10+
override some defaults that are set in `file:serialize` for backwards
11+
compatibility.
12+
13+
- `indent`: xs:boolean default `true()`
14+
Wether to remove line-endings and extra whitespace from XML-files with
15+
the exception of those in mixed content nodes.
16+
- `omit-xml-declaration`: xs:boolean default `true()`
17+
Set this to `false()` if you wish to have the XML declaration at the
18+
beginning of each XML file.
19+
- `exist:expand-x-includes`: xs:boolean default `false()`
20+
Setting this to `true()` will expand X-includes in files where
21+
they are present.
22+
23+
There are additional serialization options that apply to XML-files and can now be set in the options map. Most notably:
24+
25+
- `exist:insert-final-newline`: xs:boolean default `false()`
26+
With this option set to `true()` a newline character will be added
27+
to the very end of the document. Useful when syncing data to a git
28+
repository.
29+
30+
A list of all serialization options can be found in [the exist-db documentation on XQuery serialization](http://exist-db.org/exist/apps/doc/xquery.xml?field=all&id=D3.3.6.2#serialization)
31+
32+
In addition to all serialization settings, the map lets you specify
33+
three additional options:
1034

1135
- `after`: xs:dateTime? default `()`
1236
- synchronise only files newer than the dateTime provided

0 commit comments

Comments
 (0)